Skip to content

Commit

Permalink
makes valueAsMoment usage more consistent/idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Apr 10, 2020
1 parent 68055da commit 6914c9d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ export class EuiAbsoluteTab extends Component<
if (date === null) {
return;
}
const dateMoment = moment(date);
onChange(typeof date === 'string' ? date : date.toISOString(), event);

const valueAsMoment = moment(date);
this.setState({
valueAsMoment: dateMoment,
textInputValue: dateMoment.format(this.props.dateFormat),
valueAsMoment,
textInputValue: valueAsMoment.format(this.props.dateFormat),
isTextInvalid: false,
});
};
Expand Down

0 comments on commit 6914c9d

Please sign in to comment.