init date time picker component

This commit is contained in:
u-e 2019-05-24 21:35:30 +03:00
parent 4d7dfdb488
commit 55dd497fd0
5 changed files with 33 additions and 8 deletions

View File

@ -194,7 +194,7 @@ class BasicHeaderView extends Component {
<DatePicker
style={{ width: 50 }}
date={datePickerValue}
mode="date"
mode={datePickerValue ? 'time' : 'date'}
format="YYYY-MM-DD"
minDate={moment()}
maxDate="3000-06-01"

View File

@ -0,0 +1,22 @@
import React, { useState } from 'react';
import { View } from 'react-native';
// Styles
import styles from './dateTimePickerStyles';
const DateTimePickerView = (props) => {
const {
type,
isChecked,
onSubmit,
} = props;
const [date, setDate] = useState('');
const [time, setTime] = useState('');
return (
<View />
);
};
export default DateTimePickerView;

View File

@ -2,6 +2,7 @@ import api from '../../config/api';
import searchApi from '../../config/search';
import imageApi from '../../config/imageApi';
import serverList from '../../config/serverListApi';
import { jsonStringify } from '../../utils/jsonUtils';
export const getCurrencyRate = currency => api.get(`/currencyRate/${currency.toUpperCase()}/steem`).then(resp => resp.data);

View File

@ -132,13 +132,15 @@ class EditorContainer extends Component {
} else {
await getDraftPost(username)
.then((result) => {
this.setState({
draftPost: {
body: result.body,
title: result.title,
tags: result.tags.split(','),
},
});
if (result) {
this.setState({
draftPost: {
body: result.body,
title: result.title,
tags: result.tags.split(','),
},
});
}
});
}
};