Skip to content
Permalink
Browse files

fix date input bug (#1145)

* fix date input bug
  • Loading branch information...
Yshayy committed Jun 27, 2019
1 parent b22b3d8 commit 4ab7b1cf65ba27994cc93799bd71d1c7765b4052
Showing with 2 additions and 2 deletions.
  1. +2 −2 services/editor/src/components/common/Input/DateInput.js
@@ -10,7 +10,8 @@ import './Calendar.css';

const DateInput = compose(withState('showCalendar', 'setShowCalendar', false))(
({ onChange, value, showCalendar, setShowCalendar, ...props }) => {
const calendarDate = moment.utc(value).toDate();
const dateValue = moment.utc(value);
const calendarDate = ((dateValue.isValid() && dateValue) || moment()).toDate();

const onFocus = (evt) => {
evt.preventDefault();
@@ -32,7 +33,6 @@ const DateInput = compose(withState('showCalendar', 'setShowCalendar', false))(
);
setShowCalendar(false);
};

return (
<div onBlur={onBlur} className="date-input">
<Input {...props} onChange={onChange} onFocus={onFocus} value={value} />

0 comments on commit 4ab7b1c

Please sign in to comment.
You can’t perform that action at this time.