-
Notifications
You must be signed in to change notification settings - Fork 45
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.0Release Notes
date-fns/date-fns
v2.9.0Compare 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
eachMonthOfIntervalandeachYearOfInterval.inclusiveoption to `areIntervalsOverlapping.isExistsfunction that checks if the given date is exists.addfunction to add seconds, minutes, hours, weeks, years in single call.subfunction, the opposite ofadd.Durationtype used inaddandsub.Changed
Localetype optional.Localetype.Localetype.parseJSON.parseJSON.v2.8.1Compare Source
Thanks to @Imballinst for the bug fix!
Fixed
formatRFC3339. See #1548.v2.8.0Compare Source
Kudos to @NaridaL, @Zyten, @Imballinst, @leshakoss and @Neorth for working on the release.
Fixed
Added
formatISO,formatISO9075,formatRFC3339, andformatRFC7231functions.v2.7.0Compare Source
Thanks to @mzgajner, @NaridaL, @Zyten, @leshakoss, @fintara, @kpr-hellofresh for contributing to the release.
Fixed
parseISOin Firefox caused by differences ingetTimezoneOffset.Changed
parseJSONto accept strings without trailing 'Z' symbol and with up to 6 digits in the milliseconds' field.Added
v2.6.0Compare Source
Kudos to @marnusw, @cdrikd and @rogyvoje for working on the release!
Added
parseJSON- lightweight function (just 411 B) that parses dates formatted withtoJSON.subBusinessDaysfunction.v2.5.1Compare Source
Thanks to @mitchellbutler for the bug fix!
Fixed
addBusinessDays.v2.5.0Compare Source
Kudos to @dkozickis, @drugoi, @kranthilakum, @102, @gpetrioli and @JulienMalige for making the release happen.
Fixed
findIndexfrom the code.Added
IntervalandLocaletypes from Flow typings.v2.4.1Compare Source
Thanks to @mrclayman for reporting the issue and @leshakoss for fixing it.
Fixed
v2.4.0Compare Source
This release brought to you by these amazing people: @lovelovedokidoki, @alexigityan, @kalekseev and @andybangs. You rock!
Fixed
parseISO.Added
v2.3.0Compare 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.1Compare Source
Kudos to date-fns contributors: @mzgajner, @sibiraj-s, @mukeshmandiwal, @SneakyFish5 and @CarterLi.
Added
setfunction.\ninformat,lightFormatandparse.v2.1.0Compare Source
Thanks to date-fns contributors: @ManadayM, @illuminist, @visualfanatic, @vsaarinen and at least but not least @leshakoss!
Fixed
eachWeekendOfIntervalskipping the first date in the supplied interval.Added
v2.0.1Compare Source
Fixed
getWeekOfMonthwithoptions.weekStartsOnset to 1 not working for Sundays. Kudos to @waseemahmad31!v2.0.0Compare Source
If you're upgrading from v2 alpha or beta, see the pre-release changelog.
Fixed
Fix the
toDatebug 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
isDatenow 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
eachDayOfIntervalthat caused time in the daysafter DST change to have the shift as well.
Fix bug in Galician locale caused by incorrect usage of
getHoursinstead 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
formatfunctionwhich is based on Unicode Technical Standard #35.
See this post for more details.
51296955129695Characters are now escaped using single quote symbols (
') instead of square brackets.formatnow throws RangeError if it encounters an unescaped latin characterthat isn't a valid formatting token.
To use
YYandYYYYtokens that represent week-numbering years,you should set
useAdditionalWeekYearTokensoption:To use
DandDDtokens which represent days of the year,set
useAdditionalDayOfYearTokensoption: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
formatrequired for the sake of explicitness.BREAKING renamed ISO week-numbering year helpers:
addISOYears→addISOWeekYearsdifferenceInCalendarISOYears→differenceInCalendarISOWeekYearsdifferenceInISOYears→differenceInISOWeekYearsendOfISOYear→endOfISOWeekYeargetISOYear→getISOWeekYearisSameISOYear→isSameISOWeekYearlastDayOfISOYear→lastDayOfISOWeekYearsetISOYear→setISOWeekYearsubISOYears→subISOWeekYearsi.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→areIntervalsOverlappingeachDay→eachDayOfIntervalgetOverlappingDaysInRanges→getOverlappingDaysInIntervalsisWithinRange→isWithinIntervalThis 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
startandendpropertiesinstead of two arguments as an interval. All these functions
throw
RangeErrorif the start of the interval is after its endor if any date in the interval is
Invalid Date.BREAKING: functions renamed:
distanceInWords→formatDistancedistanceInWordsStrict→formatDistanceStrictdistanceInWordsToNow→formatDistanceToNowto make them consistent with
formatandformatRelative.BREAKING: The order of arguments of
distanceInWordsanddistanceInWordsStrictis swapped to make them consistent with
differenceIn...functions.BREAKING:
partialMethodoption informatDistanceStrictis renamed toroundingMethod.BREAKING: in
formatDistanceStrict, ifroundingMethodis not specified,it now defaults to
roundinstead offloor.BREAKING:
unitoption informatDistanceStrictnow accepts one of the strings:'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'
BREAKING:
parsethat previously used to convert strings andnumbers to dates now parse only strings in an arbitrary format
specified as an argument. Use
toDateto coerce numbers andparseISOto parse ISO 8601 strings.
BREAKING:
toDate(previouslyparse) now doesn't accept stringarguments but only numbers and dates.
toDatecalled with an invalidargument will return
Invalid Date.BREAKING: new locale format.
See docs/Locale.
Locales renamed:
en→en-USzh_cn→zh-CNzh_tw→zh-TWBREAKING: now
closestToandclosestIndexTodon't throw an exceptionwhen the second argument is not an array, and return Invalid Date instead.
BREAKING: now
isValiddoesn't throw an exceptionif the first argument is not an instance of Date.
Instead, argument is converted beforehand using
toDate.Examples:
isValidargumentnew Date()truetruenew Date('2016-01-01')truetruenew Date('')falsefalsenew Date(1488370835081)truetruenew Date(NaN)falsefalse'2016-01-01'TypeErrorfalse''TypeErrorfalse1488370835081TypeErrortrueNaNTypeErrorfalseWe 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
RangeErrorif optional values passed tooptionsare not
undefinedor have expected values.This change is introduced for consistency with ECMAScript standard library which does the same.
BREAKING:
format,formatDistance(previouslydistanceInWords) andformatDistanceStrict(previouslydistanceInWordsStrict) now throwRangeErrorif one the passed arguments is invalid. It reflects behavior oftoISOStringand Intl API. See #1032.BREAKING: all functions now implicitly convert arguments by following rules:
Notes:
Dateare converted toDateusing date-fns'toDatefunction;toIntegerimplementation(see #765);
Stringfunction;Booleanfunction.nullandundefinedpassed to optional arguments (i.e. properties ofoptionsargument)are ignored as if no argument was passed.
If any resulting argument is invalid (i.e.
NaNfor numbers andInvalid Datefor dates),an invalid value will be returned:
falsefor functions that return booleans (expectisValid);Invalid Datefor functions that return dates;NaNfor 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
TypeErrorexception 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:
nullnow is not a valid date.isValid(null)returnsfalse;toDate(null)returns an invalid date. SincetoDateis used internallyby all the functions, operations over
nullwill also return an invalid date.See #537 for the reasoning.
toDate(previouslyparse) andisValidfunctions now acceptanytypeas the first argument.
Exclude
docs.jsonfrom 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
WithOptionsadded 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:
formatRelativefunction. 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:
getWeekgetWeekYearsetWeeksetWeekYearstartOfWeekYearAdded
eachWeekOfInterval, the weekly equivalent ofeachDayOfIntervalAdded
getUnixTimefunction. Kudos to @Kingwl.New decade helpers. Thanks to @y-nk!
getDecadestartOfDecadeendOfDecadelastDayOfDecadeNew
roundToNearestMinutesfunction. 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.
eachWeekendOfIntervalis the handler function while the other two are wrapper functions. Kudos to @laekettavong!eachWeekendOfIntervaleachWeekendOfMontheachWeekendOfYearBuild-efficient
lightFormatthat only supports the popular subset of tokens. See #1050.parseISOfunction that parses ISO 8601 strings. See #1023.Add constants that can be imported directly from
date-fnsor the submoduledate-fns/constants:maxTimeminTimeNew 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
differenceInBusinessDayswhich calculates the difference in business days. Kudos to @ThorrStevens!
Add new function
addBusinessDays,similar to
addDaysbut 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.