matthewmueller/date

how crazy would this lib be if it supported ranges

ianstormtaylor opened this issue · 4 comments

"i'm available any time thursday before 2pm."

would equate to

Thursday 00:00 – Thursday 14:00

mind blown. that's all. close this whenever you want ;)

Haha yah for sure. I see this lib as handling the "point in time" dates. There's also a need for:

  • intervals
  • ranges

I started an intervals library based off this: https://github.com/matthewmueller/every but i'm not aware of any libs that handle ranges.

This lib will need a better way to extend the vocabulary to allow for things like anytime between, etc.

Just throwing this out there for anyone else who's looking:
http://gf3.github.io/moment-range/

Anyone ever attempted this?

kengz commented

yeah that'd be crazy, for example: last week would give a pair of start and end dates with a 7-day interval. Like @matthewmueller mentioned, there's 3 types of time-parser usage:

  • scheduling (this repo): give a single point in time, future or past
  • range: a generalization of scheduling = gives more than one point in time
  • cron: gives a cron time pattern, mainly to schedule a cron job.

Of course, apart from these, we need a sufficiently good natural language parsing. This shan't requirement any fancy NLP.

I think imaginable that all these can be unified under a single project?