neilgupta / Sherlock

Natural-language event parser for Javascript
https://sherlock.neil.gg
MIT License
532 stars 32 forks source link

Better support for parsing times without : separators #8

Closed neilgupta closed 11 years ago

neilgupta commented 11 years ago

Currently, Tabule supports 12 hour time formats, 24-hour time, and military time. However, each of these cases makes their own assumptions when parsing. For example, military time ignores the meridian (i.e. 1130 is read as 11:30am, even if 1130pm is written).

Unfortunately, in the real world, users often leave out the : when writing times, but still want to write 1130pm.

The military time parser needs to be updated to account for meridians, even though that is technically incorrect.

Additionally, military time expects 0830 for 8:30, but users will probably enter 830 and expect it to parse properly. Although this is more rare, it would be nice to add support for this shortcut too.