Skip to content

Commit a3a029d

Browse files
author
David Emory
committed
fix(form): Update internal date/time to current when NOW is selected as departure mode
1 parent c14d67c commit a3a029d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/components/form/date-time-selector.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class DateTimeSelector extends Component {
3131

3232
_onDepartChange = (evt) => {
3333
this.props.setQueryParam({ departArrive: evt.target.value })
34+
if (evt.target.value === 'NOW') {
35+
this.props.setQueryParam({
36+
date: moment().format('YYYY-MM-DD'),
37+
time: moment().format('HH:mm')
38+
})
39+
}
3440
}
3541

3642
_onDateChange = (evt) => {

0 commit comments

Comments
 (0)