From 9d52cb112484a173cfde81d9d8ef4de429dac819 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Wed, 24 Feb 2016 13:16:06 -0800 Subject: [PATCH] fix(snooze/send-later): Change chrono config to always prefer dates in future --- .../send-later/lib/send-later-popover.jsx | 10 ++-- .../thread-snooze/lib/snooze-popover-body.jsx | 2 +- src/date-utils.es6 | 49 ++++++++++++++++++- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/internal_packages/send-later/lib/send-later-popover.jsx b/internal_packages/send-later/lib/send-later-popover.jsx index 9bce2c29d..fb846dded 100644 --- a/internal_packages/send-later/lib/send-later-popover.jsx +++ b/internal_packages/send-later/lib/send-later-popover.jsx @@ -60,7 +60,7 @@ class SendLaterPopover extends Component { }; onSelectCustomOption = (value)=> { - const date = DateUtils.fromString(value); + const date = DateUtils.futureDateFromString(value); if (date) { this.onSelectDate(date); } else { @@ -83,7 +83,7 @@ class SendLaterPopover extends Component { renderCustomTimeSection() { const onChange = (event)=> { - this.setState({inputDate: DateUtils.fromString(event.target.value)}); + this.setState({inputDate: DateUtils.futureDateFromString(event.target.value)}); } const onKeyDown = (event)=> { @@ -130,7 +130,7 @@ class SendLaterPopover extends Component { if (scheduledDate === 'saving') { return ( -