Skip to content

Commit f5b58df

Browse files
committed
don't error out on MULTI_VALUED_PLACEHOLDER
1 parent 9447ac3 commit f5b58df

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/widgets/DateTimePicker.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
66
import React, {Component} from 'react';
77
import TextInput from './TextInput';
88
import Dropdown from './Dropdown';
9+
import {MULTI_VALUED_PLACEHOLDER} from 'lib/constants';
910

1011
const testDate = '2000-01-01';
1112
const testTime = '00:00';
@@ -16,8 +17,12 @@ export default class DateTimePicker extends Component {
1617
constructor(props, context) {
1718
super(props, context);
1819
const {time, date} = this.parsePlotlyJSDateTime(props.value);
19-
const isValidTime = isDateTime(testDate + ' ' + time) || ['', timePlaceholder].includes(time);
20-
const isValidDate = isDateTime(date + ' ' + testTime) || ['', datePlaceholder].includes(date);
20+
const isValidTime =
21+
isDateTime(testDate + ' ' + time) ||
22+
['', timePlaceholder, MULTI_VALUED_PLACEHOLDER].includes(time);
23+
const isValidDate =
24+
isDateTime(date + ' ' + testTime) ||
25+
['', datePlaceholder, MULTI_VALUED_PLACEHOLDER].includes(date);
2126

2227
this.state = {
2328
calendarOpen: false,

0 commit comments

Comments
 (0)