-
Notifications
You must be signed in to change notification settings - Fork 46
Update dependency date-fns to v2 #525
base: develop
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/coderplex/coderplex/i5uxd5le0 |
Deploy preview for coderplex ready! Built with commit 804ec92 |
978cfe2
to
f222f9c
Compare
f222f9c
to
d8858f1
Compare
d8858f1
to
2ebd8da
Compare
2ebd8da
to
836cd14
Compare
836cd14
to
ccf22f9
Compare
ccf22f9
to
96e579c
Compare
96e579c
to
16152c1
Compare
16152c1
to
8c5fe13
Compare
8c5fe13
to
d44b0c7
Compare
d44b0c7
to
804ec92
Compare
804ec92
to
fd6019b
Compare
fd6019b
to
ee11f35
Compare
ee11f35
to
eec65b9
Compare
5203104
to
3941514
Compare
3941514
to
0a040ab
Compare
0a040ab
to
8647ed8
Compare
8647ed8
to
33657d0
Compare
PR has been edited👷 This PR has received other commits, so Renovate will stop updating it to avoid conflicts or other problems. If you wish to abandon your changes and have Renovate start over you may click the "rebase" checkbox in the PR body/description. If you think this comment is in error and the branch is not modified, try deleting this comment. If it comes back again the next time Renovate runs, please submit an issue or seek config help. |
33657d0
to
6afffda
Compare
📝Changed routes:
Commit 6afffda (https://coderplex-git-renovate-date-fns-2x.coderplex.now.sh). |
This PR contains the following updates:
1.30.1
->2.9.0
Release Notes
date-fns/date-fns
v2.9.0
Compare Source
Thanks to @mborgbrant, @saintplay, @mrenty, @kibertoad, @levibuzolic, @Anshuman71, @talgautb, @filipjuza, @tobyzerner, @emil9453, @fintara, @pascaliske, @rramiachraf, @marnusw and @Imballinst for working on the release.
Fixed
formatISO
.Added
eachMonthOfInterval
andeachYearOfInterval
.inclusive
option to `areIntervalsOverlapping.isExists
function that checks if the given date is exists.add
function to add seconds, minutes, hours, weeks, years in single call.sub
function, the opposite ofadd
.Duration
type used inadd
andsub
.Changed
Locale
type optional.Locale
type.Locale
type.parseJSON
.parseJSON
.v2.8.1
Compare Source
Thanks to @Imballinst for the bug fix!
Fixed
formatRFC3339
. See #1548.v2.8.0
Compare Source
Kudos to @NaridaL, @Zyten, @Imballinst, @leshakoss and @Neorth for working on the release.
Fixed
Added
formatISO
,formatISO9075
,formatRFC3339
, andformatRFC7231
functions.v2.7.0
Compare Source
Thanks to @mzgajner, @NaridaL, @Zyten, @leshakoss, @fintara, @kpr-hellofresh for contributing to the release.
Fixed
parseISO
in Firefox caused by differences ingetTimezoneOffset
.Changed
parseJSON
to accept strings without trailing 'Z' symbol and with up to 6 digits in the milliseconds' field.Added
v2.6.0
Compare Source
Kudos to @marnusw, @cdrikd and @rogyvoje for working on the release!
Added
parseJSON
- lightweight function (just 411 B) that parses dates formatted withtoJSON
.subBusinessDays
function.v2.5.1
Compare Source
Thanks to @mitchellbutler for the bug fix!
Fixed
addBusinessDays
.v2.5.0
Compare Source
Kudos to @dkozickis, @drugoi, @kranthilakum, @102, @gpetrioli and @JulienMalige for making the release happen.
Fixed
findIndex
from the code.Added
Interval
andLocale
types from Flow typings.v2.4.1
Compare Source
Thanks to @mrclayman for reporting the issue and @leshakoss for fixing it.
Fixed
v2.4.0
Compare Source
This release brought to you by these amazing people: @lovelovedokidoki, @alexigityan, @kalekseev and @andybangs. You rock!
Fixed
parseISO
.Added
v2.3.0
Compare Source
Huge thanks to @lovelovedokidoki who improved 8 (!) locales in an unstoppable open-source rampage and @VesterDe for fixing Slovenian locale 👏
Fixed
Added
v2.2.1
Compare Source
Kudos to date-fns contributors: @mzgajner, @sibiraj-s, @mukeshmandiwal, @SneakyFish5 and @CarterLi.
Added
set
function.\n
informat
,lightFormat
andparse
.v2.1.0
Compare Source
Thanks to date-fns contributors: @ManadayM, @illuminist, @visualfanatic, @vsaarinen and at least but not least @leshakoss!
Fixed
eachWeekendOfInterval
skipping the first date in the supplied interval.Added
v2.0.1
Compare Source
Fixed
getWeekOfMonth
withoptions.weekStartsOn
set to 1 not working for Sundays. Kudos to @waseemahmad31!v2.0.0
Compare Source
If you're upgrading from v2 alpha or beta, see the pre-release changelog.
Fixed
Fix the
toDate
bug occurring when parsing ISO-8601 style dates (but not valid ISO format)with a trailing Z (e.g
2012-01Z
), it returned Invalid Date for FireFox/IE11 #510Fix
differenceIn...
functions returning negative zero in some cases:#692
isDate
now works properly with dates passed across iframes #754.Fix a few bugs that appear in timezones with offsets that include seconds (e.g. GMT+00:57:44).
See PR #789.
Fixed DST issue. See #972 and #992 for more details.
Fixed DST issue in
eachDayOfInterval
that caused time in the daysafter DST change to have the shift as well.
Fix bug in Galician locale caused by incorrect usage of
getHours
instead of
getUTCHours
.Changed
BREAKING: now functions don't accept string arguments, but only
numbers or dates. When a string is passed, it will result in
an unexpected result (
Invalid Date
,NaN
, etc).From now on a string should be parsed using
parseISO
(ISO 8601)or
parse
.In v1 we've used
new Date()
to parse strings, but it resulted in manyhard-to-track bugs caused by inconsistencies in different browsers.
To address that we've implemented our ISO 8601 parser but that made
library to significantly grow in size. To prevent inevitable bugs
and keep the library tiny, we made this trade-off.
See this post for more details.
BREAKING: new format string API for
format
functionwhich is based on Unicode Technical Standard #35.
See this post for more details.
5129695
5129695
Characters are now escaped using single quote symbols (
'
) instead of square brackets.format
now throws RangeError if it encounters an unescaped latin characterthat isn't a valid formatting token.
To use
YY
andYYYY
tokens that represent week-numbering years,you should set
useAdditionalWeekYearTokens
option:To use
D
andDD
tokens which represent days of the year,set
useAdditionalDayOfYearTokens
option:BREAKING: function submodules now use camelCase naming schema:
BREAKING: min and max functions now accept an array of dates
rather than spread arguments.
BREAKING: make the second argument of
format
required for the sake of explicitness.BREAKING renamed ISO week-numbering year helpers:
addISOYears
→addISOWeekYears
differenceInCalendarISOYears
→differenceInCalendarISOWeekYears
differenceInISOYears
→differenceInISOWeekYears
endOfISOYear
→endOfISOWeekYear
getISOYear
→getISOWeekYear
isSameISOYear
→isSameISOWeekYear
lastDayOfISOYear
→lastDayOfISOWeekYear
setISOYear
→setISOWeekYear
subISOYears
→subISOWeekYears
i.e. "ISO year" renamed to "ISO week year", which is short for
ISO week-numbering year.
It makes them consistent with locale-dependent week-numbering year helpers,
e.g.,
startOfWeekYear
.BREAKING: functions renamed:
areRangesOverlapping
→areIntervalsOverlapping
eachDay
→eachDayOfInterval
getOverlappingDaysInRanges
→getOverlappingDaysInIntervals
isWithinRange
→isWithinInterval
This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
Also these functions now accept an object with
start
andend
propertiesinstead of two arguments as an interval. All these functions
throw
RangeError
if the start of the interval is after its endor if any date in the interval is
Invalid Date
.BREAKING: functions renamed:
distanceInWords
→formatDistance
distanceInWordsStrict
→formatDistanceStrict
distanceInWordsToNow
→formatDistanceToNow
to make them consistent with
format
andformatRelative
.BREAKING: The order of arguments of
distanceInWords
anddistanceInWordsStrict
is swapped to make them consistent with
differenceIn...
functions.BREAKING:
partialMethod
option informatDistanceStrict
is renamed toroundingMethod
.BREAKING: in
formatDistanceStrict
, ifroundingMethod
is not specified,it now defaults to
round
instead offloor
.BREAKING:
unit
option informatDistanceStrict
now accepts one of the strings:'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'
BREAKING:
parse
that previously used to convert strings andnumbers to dates now parse only strings in an arbitrary format
specified as an argument. Use
toDate
to coerce numbers andparseISO
to parse ISO 8601 strings.
BREAKING:
toDate
(previouslyparse
) now doesn't accept stringarguments but only numbers and dates.
toDate
called with an invalidargument will return
Invalid Date
.BREAKING: new locale format.
See docs/Locale.
Locales renamed:
en
→en-US
zh_cn
→zh-CN
zh_tw
→zh-TW
BREAKING: now
closestTo
andclosestIndexTo
don't throw an exceptionwhen the second argument is not an array, and return Invalid Date instead.
BREAKING: now
isValid
doesn't throw an exceptionif the first argument is not an instance of Date.
Instead, argument is converted beforehand using
toDate
.Examples:
isValid
argumentnew Date()
true
true
new Date('2016-01-01')
true
true
new Date('')
false
false
new Date(1488370835081)
true
true
new Date(NaN)
false
false
'2016-01-01'
TypeError
false
''
TypeError
false
1488370835081
TypeError
true
NaN
TypeError
false
We introduce this change to make date-fns consistent with ECMAScript behavior
that try to coerce arguments to the expected type
(which is also the case with other date-fns functions).
BREAKING: functions now throw
RangeError
if optional values passed tooptions
are not
undefined
or have expected values.This change is introduced for consistency with ECMAScript standard library which does the same.
BREAKING:
format
,formatDistance
(previouslydistanceInWords
) andformatDistanceStrict
(previouslydistanceInWordsStrict
) now throwRangeError
if one the passed arguments is invalid. It reflects behavior oftoISOString
and Intl API. See #1032.BREAKING: all functions now implicitly convert arguments by following rules:
Notes:
Date
are converted toDate
using date-fns'toDate
function;toInteger
implementation(see #765);
String
function;Boolean
function.null
andundefined
passed to optional arguments (i.e. properties ofoptions
argument)are ignored as if no argument was passed.
If any resulting argument is invalid (i.e.
NaN
for numbers andInvalid Date
for dates),an invalid value will be returned:
false
for functions that return booleans (expectisValid
);Invalid Date
for functions that return dates;NaN
for functions that return numbers.See tests and PRs #460 and
#765 for exact behavior.
BREAKING: all functions now check if the passed number of arguments is less
than the number of required arguments and throw
TypeError
exception if so.BREAKING: all functions that accept numbers as arguments, now coerce
values using
Number()
and also round decimals. Positive decimals arerounded using
Math.floor
, decimals less than zero are rounded usingMath.ceil
.BREAKING: The Bower & UMD/CDN package versions are no longer supported.
BREAKING:
null
now is not a valid date.isValid(null)
returnsfalse
;toDate(null)
returns an invalid date. SincetoDate
is used internallyby all the functions, operations over
null
will also return an invalid date.See #537 for the reasoning.
toDate
(previouslyparse
) andisValid
functions now acceptany
typeas the first argument.
Exclude
docs.json
from the npm package. Kudos to @hawkrives.Added
FP functions like those in lodash,
that support currying, and, as a consequence,
functional-style function composing.
Functions with options (
format
,parse
, etc.) have two FP counterparts:one that has the options object as its first argument and one that hasn't.
The name of the former has
WithOptions
added to the end of its name.In FP functions, the order of arguments is reversed.
See FP Guide for more information.
Added support for ECMAScript Modules.
It allows usage with bundlers that support tree-shaking,
like rollup.js and webpack:
Also, ESM functions provide default export, they can be used with TypeScript
to import functions in more idiomatic way:
formatRelative
function. See formatRelativeFlow typings for
index.js
,fp/index.js
,locale/index.js
, and their ESM equivalents.See PR #558
New locale-dependent week-numbering year helpers:
getWeek
getWeekYear
setWeek
setWeekYear
startOfWeekYear
Added
eachWeekOfInterval
, the weekly equivalent ofeachDayOfInterval
Added
getUnixTime
function. Kudos to @Kingwl.New decade helpers. Thanks to @y-nk!
getDecade
startOfDecade
endOfDecade
lastDayOfDecade
New
roundToNearestMinutes
function. Kudos to @xkizer.Added new function
fromUnixTime
. Thansk to @xkizer.New interval, month, and year helpers to fetch a list of all Saturdays and Sundays (weekends) for a given date interval.
eachWeekendOfInterval
is the handler function while the other two are wrapper functions. Kudos to @laekettavong!eachWeekendOfInterval
eachWeekendOfMonth
eachWeekendOfYear
Build-efficient
lightFormat
that only supports the popular subset of tokens. See #1050.parseISO
function that parses ISO 8601 strings. See #1023.Add constants that can be imported directly from
date-fns
or the submoduledate-fns/constants
:maxTime
minTime
New locales:
Norwegian Nynorsk locale (nn)
by @draperunner.
Ukrainian locale (ua)
by @korzhyk.
Vietnamese locale (vi)
by @trongthanh.
Persian locale (fa-IR)
by @mort3za.
Latvian locale (lv)
by @prudolfs.
Bengali locale (bb)
by @nutboltu and @touhidrahman.
Hungarian (hu) and Lithuanian (lt) locales
by @izifortune and pardoeryanair.
Canadian English locale (en-CA)
by @markowsiak.
Great Britain English locale (en-GB)
by @glintik.
Uighur locale (ug)
by @abduwaly.
Add new function
differenceInBusinessDays
which calculates the difference in business days. Kudos to @ThorrStevens!
Add new function
addBusinessDays
,similar to
addDays
but ignoring weekends. Thanks to @ThorrStevens!Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.