- Lots of things were renamed. I would recommend checking the README for details, but essentially changed all
...Localfunctions (egsetLocal) to remove theLocal(egset). Also changed all...Timefunctions (egdiffTime) to remove theTime(egdiff). Also changedresetLocalandresetUTCtostartOfandstartOfUTC. - Removed
addTimeSequenceandsubtractTimeSequencefunctions. I began to feel that addition operations done in a sequence was not actually all that useful. I replaced these withaddForandsubtractForwhich work like other...Forfunctions in that they accept an object or a Map defining multiple operations. So if you need operations to be carried out in a specific order I would recommend using a Map to define them. - Added isLeapYear and isLeapYearUTC utility functions.
- Added
endOfandendOfUTCfunctions.
Fixes:
- Fix milliseconds in thousandths or less for parse methods
Breaking changes:
- Remove unix, utc, utc-short, iso, iso-short ("plug-n-play") reform handlers.
Features:
- parse and parseUTC for parsing a date from different variants of an ISO-8601 string
Fixes:
- change diff and any API that relies on it to use date.valueOf rather than Date.parse
New things:
- reformWithLocale
See the readme for how it works.
New things:
- diffTime
- compareTime
See the readme for how they work.
Breaking changes:
- reform('unix') now exports a string instead of a number.
- reform('iso'), reform('iso-short'), reform('utc'), reform('utc-short'), reform('unix') behave like other format strings, they can be combined with other format strings. Not sure why you would, but there you go.
Fun stuff:
New function, reformWithOverrides, which allows you to translate the words used in reform, or use whatever you want. See the readme for details.
The functions are even more composable, since you can combine functions together without supplying a date, allowing you to create highly customized functions that can be applied to many dates easily. See the "Usage" section of the readme for details.
This is a huge rewrite of Gregorian. It honestly might be best to look at the readme to see what all changed. The gist of it is that now Gregorian outputs individual curried functions instead of an object wrapper. This means the function names have changed to be less generic and prevent collisions with any functions you might be using, and it also means several APIs have been removed entirely: reagent (no longer needed because the validite of the date is checked in the function), recite (no longer needed because the functions return a new Date where it makes sense. reform still exists but it provides the same functionality to did previously.
There's no wrapping of dates or strings anymore, each function should have a valid Date passed in (or the default is the current time).
Moreover, some of the format strings have changed to be much simpler, completely avoiding the use of repeated letters.
- Breaking change:
+is no longer the default delimiter in theto()method. It is now|. - Breaking change:
zzin theto()method now returns something likeUTC+07:00orUTC-07:00. Hence why the default delimiter was changed. - Breaking change:
get('z')will now return the negative of what it formerly did. UTC-07:00 will now return a more sensible-7.
Dparameter added toset()andsetUTC().
- New
get()andgetUTC()methods.
- New UTC-based manipulation functions where it makes sense (
setUTC(),restartUTC()). - Converted the module setup to CommonJS to work with Node out of the box. Sorry ES6 modules :(
- Testing has been improved with many more descriptions that indicate what's being tested.