HomePhabricator

Fix a hang in fancy date picker for Ye Olde Time Years

Description

Fix a hang in fancy date picker for Ye Olde Time Years

Summary:
Fixes T12960. When the user enters a date like "1917", we currently loop ~20 million times.

Instead:

  • Be a little more careful about parsing.
  • Javascript's default behavior of interpreting "2001-02-31" as "2001-03-03" ("February 31" -> "March 3") already seems reasonable, so just let it do that.

Test Plan:
Verified these behaviors:

  • 2017-08-08 - Valid, recent.
  • 17-08-08 - Valid, recent.
  • 1917-08-08 - Valid, a century ago, no loop.
  • 2017-02-31 - "February 31", interpreted as "March 3" by Javascsript, seems reasonable.
  • Quack - Default, current time.
  • 0/0/0, 0/99/0 - Default, current time.

Reviewers: avivey, chad

Reviewed By: chad

Maniphest Tasks: T12960

Differential Revision: https://secure.phabricator.com/D18383

Details

Provenance
epriestleyAuthored on Aug 10 2017, 10:31 AM
epriestleyPushed on Aug 10 2017, 3:48 PM
Reviewer
chad
Differential Revision
D18383: Fix a hang in fancy date picker for Ye Olde Time Years
Parents
rP92c49c3772d8: Minor UX tweaks to Phortune autopay
Branches
Unknown
Tags
Unknown
Tasks
T12960: fancy date picker breaks browser if year < 1970
Build Status
Buildable 17983
Build 24149: Run Core Tests