Generate dates with readable function chaining.
Also has functions accepting numbers to help with using values provided from elsewhere.
npm install @date/generator --save
var gen =// these are equivalent:// specify each thing individuallyvar washingtonDay = gen// skip the in() and of() and specify the year in the february() callvar washingtonDay = gen// specify 'third' with a '3' to monday(),// 'february' with '1' to month()var washingtonDay = genvar thanksgiving = gen
Start with the order functions:
last()- 5 (will be last, even when last is the fourth)
Day functions are available after calling an order function, or, start with them and specify the order value as 1-5:
Month functions are available after calling a day function:
Also, shortcut making a call to
of(year) after it and specify the year in the month call, like
Last call specifies the year to function
of(year) and returns a Date instance.