neilgupta / Sherlock

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

Condensed format for time #2

Closed goldfeld closed 11 years ago

goldfeld commented 11 years ago

Things like 3h, 3min and 3s aren't recognized. Also milliseconds would be useful for timers, I want to use Sherlock for that (e.g. 3500ms, 3500 ms and 3500 milliseconds).

neilgupta commented 11 years ago

Added support for each of those formats. You should note it probably won't reliably work if you try to enter less than 1000ms, since Sherlock is designed to always return a future date. If you try to do 200ms, and if Sherlock takes longer than 200ms to process the input, it will return tomorrow's date in order to make a future date.

goldfeld commented 11 years ago

Sure, that makes sense. Thanks a lot!