mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-18 19:01:38 +03:00
Fixed date time issue
This commit is contained in:
parent
e86166755b
commit
af60efbee7
@ -40,7 +40,7 @@ class DateTimePickerView extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (date && _value) {
|
if (date && _value) {
|
||||||
const formatedDateTime = new Date(`${date} ${_value}`).toISOString();
|
const formatedDateTime = moment(`${date} ${_value}`, 'YYYY-MM-DD HH:mm').toISOString();
|
||||||
onSubmit(formatedDateTime);
|
onSubmit(formatedDateTime);
|
||||||
this._initState();
|
this._initState();
|
||||||
}
|
}
|
||||||
@ -55,11 +55,11 @@ class DateTimePickerView extends PureComponent {
|
|||||||
|
|
||||||
if (type === 'date-time') {
|
if (type === 'date-time') {
|
||||||
_type = date ? 'time' : 'date';
|
_type = date ? 'time' : 'date';
|
||||||
_format = date ? 'HH:MM' : 'YYYY-MM-DD';
|
_format = date ? 'HH:mm' : 'YYYY-MM-DD';
|
||||||
_minDate = date ? null : moment().format('YYYY-MM-DD');
|
_minDate = date ? null : moment().format('YYYY-MM-DD');
|
||||||
} else {
|
} else {
|
||||||
_type = type;
|
_type = type;
|
||||||
_format = type === 'date' ? 'YYYY-MM-DD' : 'HH:MM';
|
_format = type === 'date' ? 'YYYY-MM-DD' : 'HH:mm';
|
||||||
_minDate = type === 'date' ? moment().format('YYYY-MM-DD') : null;
|
_minDate = type === 'date' ? moment().format('YYYY-MM-DD') : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user