andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.54k stars 305 forks source link

More relative date terms #597

Open Earl-Brown opened 7 years ago

Earl-Brown commented 7 years ago

I just encountered a situation where it would be nice to say new Date.range("since the first of the quarter").

.. and since we have "the first of the year" and "...month" it seems this would be a good one to add.

new Date("the first day of the quarter")
new Date("the start of the quarter")
new Date("the last day of the quarter")
new Date("the end of the quarter")

I'm sure there's more ... but you-all probably get the idea.

andrewplummer commented 7 years ago

That's a good idea, and (hopefully) would be a simple change. Let me look into it!

Earl-Brown commented 7 years ago

Sure - thanks

scagood commented 6 years ago

I'm just going to add a couple more suggestions here:

next quarter
next {month} e.g. 'next December' or 'next Jan'

Here are some more 'abstract' ones:

next season
next Autumn

And slightly less plausible/widely used:

in two quarters