inclusive-dates icon indicating copy to clipboard operation
inclusive-dates copied to clipboard

support for compound dates

Open zaclittleberry opened this issue 5 years ago • 3 comments
trafficstars

I was doing some testing and noticed dates like "Monday" and "two weeks" work, but not "two weeks from Monday". I think being able to combine these relative dates would be really powerful and people may mistakenly assume they already do work.

zaclittleberry avatar Jul 11 '20 05:07 zaclittleberry

I'm not sure if this should be an upstream request for chrono.js. it looks like chrono v2 has support for a reference date, so presumably this could be used to feed multi-part date construction back into the parse to get the right date. But not sure where that should be implemented.

zaclittleberry avatar Jul 12 '20 03:07 zaclittleberry

This would be great .. I also hoped compound dates would work. They were the first things I tried with the demo ..

andrewflon avatar Jul 18 '20 10:07 andrewflon

Another use case: I tried "Third Thursday next month", and "Third Thursday of last month" and both times it selected the third Thursday of the current month.

GaryJones avatar Jul 19 '20 11:07 GaryJones

This is a great idea!

The actual date parsing is done via a third party library (Chrono.js https://github.com/wanasit/chrono) so I don't have full control over it from the datepicker.

There are however some options for customizing Chrono and providing additional patterns, I can have a look if that could do it

fymmot avatar Jan 12 '23 14:01 fymmot