Releases: nugit/datetime-utils
v5.1.0-alpha.3
v5.1.0-alpha.2
v5.1.0-alpha.1
5.0.3 -- 19/06/2020
v5.0.2 -- 18/03/2020
Chore
- Upgrade dependencies: #299
v5.0.1 -- 16/12/2019
v5.0.0 (31 October 2019)
This version updates
date-fns
to its latest major version 2.6.0. This fixes a bug that does not parse daylight savings dates properly for Eastern Hemisphere regions (e.g. Australia and New Zealand). The update will not allowdate
to be passed as a string type anymore. Thus, helper methods have been created to still support it.
Update
- Dependencies to their latest versions
- CircleCI node version to 12.10
- CircleCI configs to support auto publishing based on tags
Change
- Named exports instead using of default exports
Add
- Helper methods to still support
date
as a string type
v5.0.0-rc.0 (30 October 2019)
This version updates
date-fns
to its latest major version 2.6.0. This fixes a bug that does not parse daylight savings dates properly for Eastern Hemisphere regions (e.g. Australia and New Zealand). The update will not allowdate
to be passed as a string type anymore. Thus, helper methods have been created to still support it.
Update
- Dependencies to their latest versions
- CircleCI node version to 12.10
- CircleCI configs to support auto publishing based on tags
Change
- Named exports instead using of default exports
Add
- Helper methods to still support
date
as a string type
v4.0.0 (13 December 2018)
This version try to differentiate
period
andrange
concepts. The first one in a string representing the period and range is an object representing the actual date range the given period is equivalent given a base date. Sorange
is the interpretation of theperiod
.
Deprecates
year_to_date
is deprecated in favor ofthis_year
- Period format
{ start: '2018-01-01', end: '2018-02-01' }
is deprecated in favor of2018-01-01_to_2018-02-01
last_x_days_including_current
is deprecated, and will have same behavior aslast_3_days
/^last(\d+)(day|week|month|quarter|year)s?$/
format in favor of/^last_(\d+)_(day|week|month|quarter|year)s?$/
retrievePeriod
in favor ofgetRange
(period parameter should be a string)retrievePeriodParams
in favor ofgetPeriodParams
(period
parameter should be a string)calculateAutoCompare
in favor ofgetAutoCompareRangeAndLabel
(period
parameter should be a string and object keyperiod
has been renamed torange
)retrieveComparePeriod
in favor ofgetCompareRange
(bothperiod
&compareMode
parameters should be string)
Change
- period
today
is deprecated, and will have same behavior asyesterday
this_week
is equal tolast_week
when given base date is first day of the week.this_month
is equal tolast_month
when given base date is first day of the month.this_quarter
is equal tolast_quarter
when given base date is first day of the quarter.this_year
is equal tolast_year
when given base date is first day of the year.last_x_week_including_current
is equal tolast_x_week
when given base date is first day of the week.last_x_month_including_current
is equal tolast_x_month
when given base date is first day of the month.last_x_quarter_including_current
is equal tolast_x_quarter
when given base date is first day of the quarter.last_x_year_including_current
is equal tolast_x_year
when given base date is first day of the year.all_time
specification switch fromlast_3_years_including_current
to2015-01-01_to_yesterday
last_x_days_including_current
is deprecated, and will have same behavior aslast_3_days
year_to_date
is replaced bythis_year
. It's no more the complete year, but from the first day of the year to yesterday included.
Add
getRange
replacingretrievePeriod
getPeriodParams
replacingretrievePeriodParams
getCompareRange
replacingretrieveComparePeriod
getAutoCompareRangeAndLabel
replacingcalculateAutoCompare
getTillYesterdayPeriod
getCustomPeriod
getLastPeriod
getThisPeriod
formatDate
migrateLegacyPeriod
transform legacy period format to new onemigrateLegacyCompareMode
transform legacy compare mode format to new onetoLegacyPeriod
reverse ofmigrateLegacyPeriod
toLegacyCompareMode
reverse ofmigrateLegacyCompareMode
Fix
this_quarter
was inconsistent withthis_week
,this_month
&this_year
. Nowthis_quarter
starts from the beginning of the quarter to yesterday included.last_x_quarters
was inconsistent withlast_x_days
,last_x_weeks
,last_x_months
&last_x_years
. It's no more one quarter length, butx
quarters length.