| 210 | hasTime, |
| 211 | ...overlayState, |
| 212 | setOpen(isOpen) { |
| 213 | // Commit the selected date when the calendar is closed. Use a placeholder time if one wasn't set. |
| 214 | // If only the time was set and not the date, don't commit. The state will be preserved until |
| 215 | // the user opens the popover again. |
| 216 | if (!isOpen && !value && selectedDate && hasTime) { |
| 217 | commitValue( |
| 218 | selectedDate, |
| 219 | selectedTime || getPlaceholderTime(props.defaultValue || props.placeholderValue) |
| 220 | ); |
| 221 | } |
| 222 | |
| 223 | overlayState.setOpen(isOpen); |
| 224 | }, |
| 225 | validationState, |
| 226 | isInvalid: isValueInvalid, |
| 227 | formatValue(locale, fieldOptions) { |