diff --git a/src/components/dateTimePicker/view/dateTimePickerView.js b/src/components/dateTimePicker/view/dateTimePickerView.js index 09b513b18..56b0ebf95 100644 --- a/src/components/dateTimePicker/view/dateTimePickerView.js +++ b/src/components/dateTimePicker/view/dateTimePickerView.js @@ -40,7 +40,7 @@ class DateTimePickerView extends PureComponent { } if (date && _value) { - const formatedDateTime = new Date(`${date} ${_value}`).toISOString(); + const formatedDateTime = moment(`${date} ${_value}`, 'YYYY-MM-DD HH:mm').toISOString(); onSubmit(formatedDateTime); this._initState(); } @@ -55,11 +55,11 @@ class DateTimePickerView extends PureComponent { if (type === 'date-time') { _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'); } else { _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; }