UNPKG

120 kBMarkdownView Raw
1# Change Log
2
3All notable changes to this project will be documented in this file.
4This project adheres to [Semantic Versioning].
5
6This change log follows the format documented in [Keep a CHANGELOG].
7
8[semantic versioning]: http://semver.org/
9[keep a changelog]: http://keepachangelog.com/
10
11## v4.1.0 - 2024-09-17
12
13This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.
14
15Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14).
16
17### Fixed
18
19- Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#3885](https://github.com/date-fns/date-fns/issues/3885).
20
21### Added
22
23- Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#3886](https://github.com/date-fns/date-fns/issues/3886).
24
25## v4.0.0 - 2024-09-16
26
27I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.
28
29Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward.
30
31[Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/).
32
33\- [Sasha @kossnocorp](https://twitter.com/kossnocorp)
34
35### Added
36
37- Added time zones support via [`@date-fns/tz`](https://github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://github.com/date-fns/tz) for the details about the API.
38
39- All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone:
40
41 ```ts
42 import { addDays, startOfDay } from "date-fns";
43 import { tz } from "@date-fns/tz";
44
45 startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));
46 //=> "2024-09-16T00:00:00.000+08:00"
47 ```
48
49 In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore.
50
51### Changed
52
53- The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers).
54
55 The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`.
56
57 In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`.
58
59 ```ts
60 clamp(Date.now(), {
61 start: new TZDate(start, "Asia/Singapore"),
62 end: new UTCDate(),
63 });
64 //=> TZDate
65 ```
66
67- **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you running the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://github.com/date-fns/date-fns/issues/new).
68
69- **BREAKING**: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please [report them](https://github.com/date-fns/date-fns/issues/new).
70
71### Fixed
72
73- Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE.
74
75## v3.6.0 - 2024-03-18
76
77On this release worked @kossnocorp and @world1dan. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
78
79### Fixed
80
81- [Fixed weeks in the Belarisuan locale's `formatDistance`.](https://github.com/date-fns/date-fns/pull/3720)
82
83### Added
84
85- [Added CDN versions of modules compatible with older browsers.](https://github.com/date-fns/date-fns/pull/3737) [See the CDN guide.](https://date-fns.org/docs/CDN)
86
87## v3.5.0 - 2024-03-15
88
89Kudos to @fturmel, @kossnocorp, @makstyle119, @tan75, @marcreichel, @tareknatsheh and @audunru for working on the release. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
90
91### Fixed
92
93- [Fixed functions that use current date internally and made them work with date extensions like `UTCDate`.](https://github.com/date-fns/date-fns/issues/3730)
94
95- [Fixed `daysToWeeks` returning negative 0.](https://github.com/date-fns/date-fns/commit/882ced61c692c7c4a79eaaec6eb07cb9c8c9195b)
96
97- [Fixed German grammar for the "half a minute" string.](https://github.com/date-fns/date-fns/pull/3715)
98
99### Added
100
101- [Added the Northern Sámi (`se`) locale.](https://github.com/date-fns/date-fns/pull/3724)
102
103- Added the `constructNow` function that creates the current date using the passed reference date's constructor.
104
105## v3.4.0 - 2024-03-11
106
107Kudos to @kossnocorp, @sakamossan and @Revan99 for working on the release. Also, thanks to [@seated](https://github.com/seated) [for sponsoring me](https://github.com/sponsors/kossnocorp).
108
109### Added
110
111- [Added `roundToNearestHours` function.](https://github.com/date-fns/date-fns/pull/2752)
112
113- [Added Central Kurdish (`ckb`) locale.](https://github.com/date-fns/date-fns/pull/3421)
114
115## v3.3.1 - 2024-01-22
116
117Kudos to @kossnocorp and @fturmel for working on the release.
118
119### Fixed
120
121- Fixed DST issue in `getOverlappingDaysInIntervals`, resulting in an inconsistent number of days returned for intervals starting and ending in different DST periods.
122
123- Fixed functions incorrectly using `trunc` instead of `round`. The bug was introduced in v3.3.0. The affected functions: `differenceInCalendarDays`, `differenceInCalendarISOWeeks`, `differenceInCalendarWeeks`, `getISOWeek`, `getWeek`, and `getISOWeeksInYear`.
124
125## v3.3.0 - 2024-01-20
126
127On this release worked @kossnocorp, @TheKvikk, @fturmel and @ckcherry23.
128
129### Fixed
130
131- Fixed the bug in `getOverlappingDaysInIntervals` caused by incorrect sorting of interval components that led to 0 for timestamps of different lengths.
132
133- Fixed bugs when working with negative numbers caused by using `Math.floor` (`-1.1` → `-2`) instead of `Math.trunc` (`-1.1` → `-1`). Most of the conversion functions (i.e., `hoursToMinutes`) were affected when passing some negative fractional input. Also, some other functions that could be possibly affected by unfortunate timezone/date combinations were fixed.
134
135 The functions that were affected: `format`, `parse`, `getUnixTime`, `daysToWeeks`, `hoursToMilliseconds`, `hoursToMinutes`, `hoursToSeconds`, `milliseconds`, `minutesToMilliseconds`, `millisecondsToMinutes`, `monthsToYears`, `millisecondsToHours`, `millisecondsToSeconds`, `minutesToHours`, `minutesToSeconds`, `yearsToQuarters`, `yearsToMonths`, `yearsToDays`, `weeksToDays`, `secondsToMinutes`, `secondsToHours`, `quartersToYears`, `quartersToMonths` and `monthsToQuarters`.
136
137- [Fixed the Czech locale's `formatDistance` to include `1` in `formatDistance`.](https://github.com/date-fns/date-fns/pull/3269)
138
139- Fixed `differenceInSeconds` and other functions relying on rounding options that can produce a negative 0.
140
141- [Added a preprocessor to the locales API, enabling fixing a long-standing bug in the French locale.](https://github.com/date-fns/date-fns/pull/3662) ([#1391](https://github.com/date-fns/date-fns/issues/1391))
142
143- Added missing `yearsToDays` to the FP submodule.
144
145- Made functions using rounding methods always return `0` instead of `-0`.
146
147### Added
148
149- [Added `format` alias `formatDate` with corresponding `FormatDateOptions` interface](https://github.com/date-fns/date-fns/pull/3653).
150
151## v3.2.0 - 2024-01-09
152
153This release is brought to you by @kossnocorp, @fturmel, @grossbart, @MelvinVermeer, and @jcarstairs-scottlogic.
154
155### Fixed
156
157- Fixed types compatibility with Lodash's `flow` and fp-ts's `pipe`. ([#3641](https://github.com/date-fns/date-fns/issues/3641))
158
159- [Fixed inconsistent behavior of `roundToNearestMinutes`.](https://github.com/date-fns/date-fns/pull/3132)
160
161### Added
162
163- Added exports of `format`, `lightFormat`, and `parse` internals that enable 3rd-parties to consume those.
164
165## v3.1.0 - 2024-01-05
166
167This release is brought to you by @kossnocorp, @makstyle119 and @dmgawel.
168
169### Fixed
170
171- [Fixed the plural form of weeks in Swedish](https://github.com/date-fns/date-fns/pull/3448).
172
173### Added
174
175- [Added `yearsToDays` function](https://github.com/date-fns/date-fns/pull/3540).
176
177- Added warning about using protected tokens like `Y` or `D` without passing a corresponding option. [See #2950](https://github.com/date-fns/date-fns/issues/2950).
178
179## v3.0.6 - 2023-12-22
180
181On this release worked @imwh0im, @jamcry and @tyrw.
182
183### Fixed
184
185- [Fixed bug in `areIntervalsOverlapping` caused by incorrect sorting](https://github.com/date-fns/date-fns/pull/3628) ([#3614](https://github.com/date-fns/date-fns/issues/3614))
186
187## v3.0.5 - 2023-12-21
188
189This release is brought to you by @goku4199.
190
191### Fixed
192
193- [Fixed internal `toDate` not processing string arguments properly](https://github.com/date-fns/date-fns/pull/3626)
194
195## v3.0.4 - 2023-12-21
196
197This release is brought to you by @kossnocorp.
198
199### Fixed
200
201- Fixed isWithinInterval bug caused by incorrectly sorting dates ([#3623](https://github.com/date-fns/date-fns/issues/3623)).
202
203## v3.0.3 - 2023-12-21
204
205### Fixed
206
207- Rolled back pointing ESM types to the same `d.ts` files. Instead now it copies the content to avoid [the Masquerading as CJS problem](https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md) reported by "Are the types wrong?".
208
209## v3.0.2 - 2023-12-21
210
211### Fixed
212
213- Fixed [yet another issue caused by ESM types](https://github.com/date-fns/date-fns/issues/3620) by pointing to the same `d.ts` files.
214
215- [Added `package.json` to exports](https://github.com/date-fns/date-fns/pull/3601) to provide access to tooling.
216
217- [Fixed TypeScript 5.4 build break](https://github.com/date-fns/date-fns/pull/3598) by using the latest type names.
218
219## v3.0.1 - 2023-12-20
220
221### Fixed
222
223- [Fixed an error](https://github.com/date-fns/date-fns/pull/3618) in certain environments caused by `d.mts` files exporting only types.
224
225## v3.0.0 - 2023-12-18
226
227### Changed
228
229- **BREAKING**: date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the `package.json`. The ESM files now have `.mjs` extension.
230
231- **BREAKING**: The package now has a flat structure, meaning functions are now named `node_modules/date-fns/add.mjs`, locales are `node_modules/date-fns/locale/enUS.mjs`, etc.
232
233- **BREAKING**: Now all file content’s exported via named exports instead of `export default`, which will require change direct imports i.e. `const addDays = require(‘date-fns/addDays’)` to `const { addDays } = require(‘date-fns/addDays’)`.
234
235- **BREAKING**: TypeScript types are now completely rewritten, check out the `d.ts` files for more information.
236
237- **BREAKING**: `constants` now is not exported via the index, so to import one use `import { daysInYear } from "date-fns/constants";`. It improves compatibility with setups that modularize imports [like Next.js](https://twitter.com/kossnocorp/status/1731181274579325260).
238
239- **BREAKING**: Functions now don’t check the number of passed arguments, delegating this task to type checkers. The functions are now slimmer because of this.
240
241- **BREAKING** The arguments are not explicitly converted to the target types. Instead, they are passed as is, delegating this task to type checkers.
242
243- **BREAKING**: Functions that accept `Interval` arguments now do not throw an error if the start is before the end and handle it as a negative interval. If one of the properties in an `Invalid Date`, these functions also do not throw and handle them as invalid intervals.
244
245 - `areIntervalsOverlapping` normalize intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. When comparing intervals with one of the properties being `Invalid Date`, the function will return false unless the others are valid and equal, given the `inclusive` option is passed. Otherwise, and when even one of the intervals has both properties invalid, the function will always return `false`.
246
247 - `getOverlappingDaysInIntervals` now normalizes intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. If any of the intervals’ properties is an `Invalid Date`, the function will always return 0.
248
249 - `isWithinInterval` now normalizes intervals before comparison, so `{ start: a, end: b }` is practically equivalent to `{ start: b, end: a }`. If any of the intervals’ properties is an `Invalid Date`, the function will always return false.
250
251 - `intervalToDuration` now returns negative durations for negative intervals. If one or both of the interval properties are invalid, the function will return an empty object.
252
253 - The eachXOfInterval functions (`eachDayOfInterval`, `eachHourOfInterval`, `eachMinuteOfInterval`, `eachMonthOfInterval`, `eachWeekendOfInterval`, `eachWeekendOfMonth`, `eachWeekendOfYear`, `eachWeekOfInterval`, `eachYearOfInterval`) now return a reversed array if the passed interval’s start is after the end. Invalid properties will result in an empty array. Functions that accept the `step` option now also allow negative, 0, and NaN values and return reversed results if the step is negative and an empty array otherwise.
254
255- **BREAKING**: `intervalToDuration` now skips 0 values in the resulting duration, resulting in more compact objects with only relevant properties.
256
257- **BREAKING**: `roundToNearestMinutes` now returns `Invalid Date` instead of throwing an error when `nearestTo` option is less than 1 or more than 30.
258
259- **BREAKING**: IE is no longer supported.
260
261- **BREAKING**: Now all functions use `Math.trunc` rounding method where rounding is required. The behavior is configurable on a per-function basis.
262
263- **BREAKING**: Undocumented `onlyNumeric` option was removed from `nn` and `sv` locales. If you relied on it, [please contact me](mailto:koss@nocorp.me).
264
265- **BREAKING**: Flow is not supported anymore. If you relied on it, [please contact me](mailto:koss@nocorp.me).
266
267- **BREAKING**: The locales now use regular functions instead of the UTC version, which should not break any code unless you used locales directly.
268
269### Added
270
271- All functions that accept date arguments now also accept strings.
272
273- All functions now export options interfaces.
274
275- Now functions allow passing custom Date extensions like [UTCDate](https://github.com/date-fns/utc). They will detect and use the arguments constructor to generate the result of the same class.
276
277- `eachMonthOfInterval`, `eachQuarterOfInterval`, `eachWeekOfInterval`, and `eachYearOfInterval` now accept the `step` option like most of the eachXOfInterval functions.
278
279- A new `interval` function that validates interval, emulating the v2 interval functions behavior.
280
281- `differenceInX` functions now accept options and allow setting up `roundingMethod` that configures how the result is rounded. `Math.trunc` is the default method.
282
283## v2.30.0
284
285Kudos to @kossnocorp and @Andarist for working on the release.
286
287### Changes
288
289- Fixed increased build size after enabling compatibility with older browsers in the previous release. This was done by adding @babel/runtime as a dependency. [See more details](https://github.com/date-fns/date-fns/issues/3208#issuecomment-1528592465).
290
291## v2.29.3 - 2022-09-13
292
293This release is prepared by our own @leshakoss.
294
295### Fixed
296
297- [Fixed Ukrainian (`uk`) locale grammar for `formatDistance`.](https://github.com/date-fns/date-fns/pull/3175)
298
299- [Improved browser compatibility by transforming the code with `@babel/preset-env`.](https://github.com/date-fns/date-fns/pull/3167)
300
301## v2.29.2 - 2022-08-18
302
303This release is brought to you by @nopears, @vadimpopa and @leshakoss.
304
305### Fixed
306
307- [Fixed `sv` locale abbreviated months matcher.](https://github.com/date-fns/date-fns/pull/3160)
308
309- [Fixed `uk` locale abbreviated months matcher.](https://github.com/date-fns/date-fns/pull/3139)
310
311- [Fixed a breaking change in `intervalToDuration` by removing a recently introduced RangeError.](https://github.com/date-fns/date-fns/pull/3153)
312
313## v2.29.1 - 2022-08-18
314
315Thanks to @fturmel for working on the release.
316
317### Fixed
318
319- [Fixed TypeScript and flow types for daysInYear constant.](https://github.com/date-fns/date-fns/pull/3125)
320
321## v2.29.0 - 2022-07-22
322
323On this release worked @tan75, @kossnocorp, @nopears, @Balastrong, @cpapazoglou, @dovca, @aliasgar55, @tomchentw, @JuanM04, @alexandresaura, @fturmel, @aezell, @andersravn, @TiagoPortfolio, @SukkaW, @Zebreus, @aviskarkc10, @maic66, @a-korzun, @Mejans, @davidspiess, @alexgul1, @matroskin062, @undecaf, @mprovenc, @jooola and @leshakoss.
324
325### Added
326
327- [Added `intlFormatDistance` function`.](https://github.com/date-fns/date-fns/pull/2173)
328
329- [Added `setDefaultOptions` and `getDefaultOptions` functions that allow you to set default default locale, `weekStartsOn` and `firstWeekContainsDate`.](https://github.com/date-fns/date-fns/pull/3069)
330
331- [Added `roundingMethod` option to `roundToNearestMinutes`.](https://github.com/date-fns/date-fns/pull/3091)
332
333- [Added Swiss Italian locale (`it-CH`).](https://github.com/date-fns/date-fns/pull/2886)
334
335- [Added Occitan (`oc`) locale.](https://github.com/date-fns/date-fns/pull/2106) ([#2061](https://github.com/date-fns/date-fns/issues/2061))
336
337- [Added Belarusian Classic (`be-tarask`) locale.](https://github.com/date-fns/date-fns/pull/3115)
338
339### Fixed
340
341- [Fixed Azerbaijani (`az`) locale for `formatDistance`.](https://github.com/date-fns/date-fns/pull/2924)
342
343- [Fixed Czech (`cs`) locale for `parse`.](https://github.com/date-fns/date-fns/pull/3059)
344
345- [Fixed TypeScript types for constants.](https://github.com/date-fns/date-fns/pull/2941)
346
347- [Fixed long formatters in the South African English locale (`en-ZA`).](https://github.com/date-fns/date-fns/pull/3014)
348
349- [Fixed a typo in the Icelandic locale (`is`) for `format`.](https://github.com/date-fns/date-fns/pull/2974)
350
351- [Fixed weekday format for `formatRelative` in the Portuguese locale (`pt`).](https://github.com/date-fns/date-fns/pull/2992)
352
353- [Fixed `intervalToDuration` being off by 1 day sometimes.](https://github.com/date-fns/date-fns/pull/2616)
354
355- [Fixed ordinal number formatting in Italian locale (`it`).](https://github.com/date-fns/date-fns/pull/1617)
356
357- [Fixed issue parsing months in Croatian (`hr`), Georgian (`ka`) and Serbian (`sr` and `sr-Latn`) locales.](https://github.com/date-fns/date-fns/pull/2898)
358
359### Changed
360
361- [Replaced `git.io` links with full URLs in error messages.](https://github.com/date-fns/date-fns/pull/3021)
362
363- [_Internal_: removed "v2.0.0 breaking changes" section from individual function docs](https://github.com/date-fns/date-fns/pull/2905)
364
365## v2.28.0 - 2021-12-28
366
367Kudos to @tan75, @fturmel, @arcanar7, @jeffjose, @helmut-lang, @zrev2220, @jooola, @minitesh, @cowboy-bebug, @mesqueeb, @JuanM04, @zhirzh, @damon02 and @leshakoss for working on the release.
368
369### Added
370
371- [Added West Frisian (`fy`) locale.](https://github.com/date-fns/date-fns/pull/2183)
372
373- [Added Uzbek Cyrillic locale (`uz-Cyrl`).](https://github.com/date-fns/date-fns/pull/2811)
374
375### Fixed
376
377- [add the missing accent mark for Saturday in Spanish locale (`es`) for `format`.](https://github.com/date-fns/date-fns/pull/2869)
378
379- [allowed `K` token to be used with `a` or `b` in `parse`.](https://github.com/date-fns/date-fns/pull/2814)
380
381## v2.27.0 - 2021-11-30
382
383Kudos to @tan75, @hg-pyun, @07akioni, @razvanmitre, @Haqverdi, @pgcalixto, @janziemba, @fturmel, @JuanM04, @zhirzh, @seanghay, @bulutfatih, @nodeadtree, @cHaLkdusT, @a-korzun, @fishmandev, @wingclover, @Zacharias3690, @kossnocorp and @leshakoss for working on the release.
384
385### Fixed
386
387- [Fixed translation for quarters in `format` in Chinese Simplified locale (`zh-CN`).](https://github.com/date-fns/date-fns/pull/2771)
388
389- [Fixed `P` token in `format` for Romanian locale (`ro`).](https://github.com/date-fns/date-fns/pull/2213)
390
391- [Fixed era and month formatters in Azerbaijani locale (`az`).](https://github.com/date-fns/date-fns/pull/1632)
392
393- [Fixed `formatRelative` patterns in Georgian locale (`ka`).](https://github.com/date-fns/date-fns/pull/2797)
394
395- [Fixed regular expressions for `parse` in Estonian locale (`er`).](https://github.com/date-fns/date-fns/pull/2038)
396
397- [Fixed the format of zeros in `formatDuration` in Czech locale (`cs`).](https://github.com/date-fns/date-fns/pull/2579)
398
399- [Fixed ordinal formatting for years, weeks, hours, minutes and seconds in `fr`, `fr-CA` and `fr-CH` locales.](https://github.com/date-fns/date-fns/pull/2626)
400
401- [Fixed constants not having proper TypeScript and Flow types.](https://github.com/date-fns/date-fns/pull/2791)
402
403- [Fixed translation for Monday in Turkish locale (`tr`).](https://github.com/date-fns/date-fns/pull/2720)
404
405- [Fixed `eachMinuteOfInterval` not handling intervals less than a minute correctly.](https://github.com/date-fns/date-fns/pull/2603)
406
407- [Fixed flow types for `closestTo` and `closestIndexTo`.](https://github.com/date-fns/date-fns/pull/2781)
408
409### Added
410
411- [Added Khmer locale (`km`).](https://github.com/date-fns/date-fns/pull/2713)
412
413## v2.26.0 - 2021-11-19
414
415Thanks to @kossnocorp, @leshakoss, @tan75, @gaplo, @AbdAllahAbdElFattah13, @fturmel, @kentaro84207, @V-Gutierrez, @atefBB, @jhonatanmacazana, @zhirzh, @Haqverdi, @mandaputtra, @micnic and @rikkalo for working on the release.
416
417### Fixed
418
419- [Fixed `formatRelative` format for `lastWeek` in Spanish locale.](https://github.com/date-fns/date-fns/pull/2753)
420
421- [Fixed translation for October in Hindi locale.](https://github.com/date-fns/date-fns/pull/2729)
422
423- [Fixed Azerbaijani locale to use correct era matchers for `parse`.](https://github.com/date-fns/date-fns/pull/1633)
424
425- [Added the functions that use `weekStartsOn` and `firstWeekContainsDate` that were missing from the `Locale` documentation page.](https://github.com/date-fns/date-fns/pull/2652)
426
427### Changed
428
429- [Changed abbreviation for August from "Ags" to "Agt" in Indonesian locale.](https://github.com/date-fns/date-fns/pull/2658)
430
431### Added
432
433- [Added Irish English locale (`en-IE`).](https://github.com/date-fns/date-fns/pull/2772)
434
435- [Added Arabic locale (`ar`).](https://github.com/date-fns/date-fns/pull/2721) ([#1670](https://github.com/date-fns/date-fns/issues/1670))
436
437- [Added Hong Kong Traditional Chinese locale (zh-HK).](https://github.com/date-fns/date-fns/pull/2686) ([#2684](https://github.com/date-fns/date-fns/issues/2684))
438
439- [Added Egyptian Arabic locale (ar-EG).](https://github.com/date-fns/date-fns/pull/2699)
440
441## v2.25.0 - 2021-10-05
442
443This release is brought to you by @kossnocorp, @gierschv, @fturmel, @redbmk, @mprovenc, @artyom-ivanov and @tan75.
444
445### Added
446
447- [Added Japanese Hiragana locale (`ja-Hira`).](https://github.com/date-fns/date-fns/pull/2663)
448
449- [Added standalone months support to `de` and `de-AT` locales.](https://github.com/date-fns/date-fns/pull/2602)
450
451## v2.24.0 - 2021-09-17
452
453Kudos to [Sasha Koss](http://github.com/kossnocorp), [Lucas Silva](http://github.com/LucasHFS), [Jan Ziemba](http://github.com/janziemba), [Anastasia Kobzar](http://github.com/rikkalo), [Deepak Gupta](http://github.com/Mr-DG-Wick), [Jonas L](http://github.com/jooola), [Kentaro Suzuki](http://github.com/kentaro84207), [Koussay Haj Kacem](http://github.com/essana3), [fturmel](http://github.com/fturmel), [Tan75](http://github.com/tan75) and [Adriaan Callaerts](http://github.com/call-a3) for working on the release.
454
455### Fixed
456
457- [Fixed an edge case in the Slovak locale caused by unescaped character.](https://github.com/date-fns/date-fns/pull/2540) ([#2083](https://github.com/date-fns/date-fns/issues/2083))
458
459### Changed
460
461- [Used `1` instead of `ein` for German `formatDuration` to make it consistent with other locales and formats.](https://github.com/date-fns/date-fns/pull/2576) ([#2505](https://github.com/date-fns/date-fns/issues/2505))
462
463- [Made Norwegian `formatDuration` consistent with other locales by using numeric representation instead of written.](https://github.com/date-fns/date-fns/pull/2631) ([#2469](https://github.com/date-fns/date-fns/issues/2469))
464
465- [Use the word "sekunda" instead of "vteřina" for second in the Czech locale.](https://github.com/date-fns/date-fns/pull/2577)
466
467- [Made Flemish short date format corresponds to the Flemish government.](https://github.com/date-fns/date-fns/pull/2535)
468
469### Added
470
471- [Added `roundingMethod` option to `differenceInHours`, `differenceInMinutes`, `differenceInQuarters`, `differenceInSeconds` and `differenceInWeeks` with `trunc` as the default method.](https://github.com/date-fns/date-fns/pull/2571) ([#2555](https://github.com/date-fns/date-fns/issues/2555))
472
473- [Added new functions: `previousDay`, `previousMonday`, `previousTuesday`, `previousWednesday`, `previousThursday`, `previousFriday`, `previousSaturday` and `previousSunday`.](https://github.com/date-fns/date-fns/pull/2522)
474
475## v2.23.0 - 2021-07-23
476
477Thanks to [Liam Tait](http://github.com/Liam-Tait), [fturmel](http://github.com/fturmel), [Takuya Uehara](http://github.com/indigolain), [Branislav Lazic](http://github.com/BranislavLazic), [Seyyed Morteza Moosavi](http://github.com/smmoosavi), [Felipe Armoni](http://github.com/komyg), [Sasha Koss](http://github.com/kossnocorp), [Michael Mok](http://github.com/pmmmwh), [Tan75](http://github.com/tan75) and [Maxim Topciu](http://github.com/maximtop) for working on the release.
478
479### Changed
480
481- [Improved `nextDay` performance by roughly 50%.](https://github.com/date-fns/date-fns/pull/2524)
482
483- [Added more ordinal formatting to the Japanese locale.](https://github.com/date-fns/date-fns/pull/2471)
484
485### Added
486
487- [Added a new `clamp` function that allows to bound a date to an interval.](https://github.com/date-fns/date-fns/pull/2498)
488
489- [Added Bosnian locale (bs).](https://github.com/date-fns/date-fns/pull/2495)
490
491- [Allowed passing `undefined` in the duration to add and sub functions.](https://github.com/date-fns/date-fns/pull/2515)
492
493## v2.22.1 - 2021-05-28
494
495Thanks to [Sasha Koss](http://github.com/kossnocorp) for working on the release.
496
497### Fixed
498
499- Fixed constant typings. ([#2491](https://github.com/date-fns/date-fns/issues/2491))
500
501## v2.22.0 - 2021-05-28
502
503[Sasha Koss](http://github.com/kossnocorp), [Lucas Silva](http://github.com/LucasHFS), [Lay](http://github.com/brownsugar), [jwbth](http://github.com/jwbth), [fturmel](http://github.com/fturmel), [Tan75](http://github.com/tan75) and [Anastasia Kobzar](http://github.com/rikkalo) worked on this release.
504
505### Fixed
506
507- [Fixed Taiwanese locale to use traditional Chinese and removed unnecessary spaces.](https://github.com/date-fns/date-fns/pull/2436)
508
509- [Fixed Russian locale to use correct long formats.](https://github.com/date-fns/date-fns/pull/2478)
510
511### Added
512
513- [Added 18 new conversion functions](https://github.com/date-fns/date-fns/pull/2433):
514 - `daysToWeeks`
515 - `hoursToMilliseconds`
516 - `hoursToMinutes`
517 - `hoursToSeconds`
518 - `millisecondsToHours`
519 - `millisecondsToMinutes`
520 - `millisecondsToSeconds`
521 - `minutesToHours`
522 - `minutesToMilliseconds`
523 - `minutesToSeconds`
524 - `monthsToQuarters`
525 - `monthsToYears`
526 - `quartersToMonths`
527 - `quartersToYears`
528 - `secondsToHours`
529 - `secondsToMilliseconds`
530 - `secondsToMinutes`
531 - `weeksToDays`
532 - `yearsToMonths`
533 - `yearsToQuarters`
534
535## v2.21.3 - 2021-05-08
536
537This release is brought to you by [Maxim Topciu](http://github.com/maximtop).
538
539### Fixed
540
541- [Fixed IE11 support by babelifing the shorthand properties.](https://github.com/date-fns/date-fns/pull/2467)
542
543## v2.21.2 - 2021-05-05
544
545Kudos to [Aleksei Korzun](http://github.com/a-korzun), [Maxim Topciu](http://github.com/maximtop), [Jonas L](http://github.com/jooola), [Mohammad ali Ali panah](http://github.com/always-maap) and [Tan75](http://github.com/tan75) for working on the release.
546
547### Fixed
548
549- [`differenceInBusinessDays` now returns `NaN` instead of `Invalid Date` when an invalid argument is passed to the function.](https://github.com/date-fns/date-fns/pull/2414)
550
551- [Fixed `weekStartsOn` in Persian locale.](https://github.com/date-fns/date-fns/pull/2430)
552
553## v2.21.1 - 2021-04-15
554
555Thanks to [Sasha Koss](http://github.com/kossnocorp) for working on the release.
556
557### Fixed
558
559- [Fixed a breaking change introduced by using modern default argument value syntax (see https://github.com/Hacker0x01/react-datepicker/issues/2870).](https://github.com/date-fns/date-fns/pull/2423)
560
561## v2.21.0 - 2021-04-14
562
563This release is brought to you by [Aleksei Korzun](http://github.com/a-korzun), [Tan75](http://github.com/tan75), [Rubens Mariuzzo](http://github.com/rmariuzzo), [Christoph Stenglein](http://github.com/cstenglein) and [Clément Tamisier](http://github.com/ctamisier).
564
565### Fixed
566
567- [Made `formatDistanceStrict` return `12 months` instead of `1 year` when `unit: 'month'`.](https://github.com/date-fns/date-fns/pull/2411)
568
569### Added
570
571- [Added Haitian Creole (`ht`) locale.](https://github.com/date-fns/date-fns/pull/2396)
572- [Added Austrian German (`de-AT`) locale.](https://github.com/date-fns/date-fns/pull/2362)
573
574## v2.20.3 - 2021-04-13
575
576Kudos to [fturmel](http://github.com/fturmel) for working on the release.
577
578### Fixed
579
580- [Fixed broken tree-shaking caused by missing links to corresponding ESM.](https://github.com/date-fns/date-fns/pull/2339) ([#2207](https://github.com/date-fns/date-fns/issues/2207))
581
582## v2.20.2 - 2021-04-12
583
584Kudos to [Maxim Topciu](http://github.com/maximtop) for working on the release.
585
586### Fixed
587
588- [Fixed IE11 incompatibility caused by the usage of spread syntax.](https://github.com/date-fns/date-fns/pull/2407) ([#2408](https://github.com/date-fns/date-fns/issues/2408))
589
590## v2.20.1 - 2021-04-09
591
592This release is brought to you by [Sasha Koss](http://github.com/kossnocorp) and [Tan75](http://github.com/tan75).
593
594### Fixed
595
596- Fixed `isDate` Flow typings that we broke in `v2.20.0`.
597
598## v2.20.0 - 2021-04-08
599
600This release is brought to you by [Sasha Koss](http://github.com/kossnocorp), [Maxim Topciu](http://github.com/maximtop), [tu4mo](http://github.com/tu4mo), [Tan75](http://github.com/tan75), [Ardit Dine](http://github.com/arditdine), [Carl Rosell](http://github.com/CarlRosell), [Roman Mahotskyi](http://github.com/enheit), [Mateusz Krzak](http://github.com/mateuszkrzak), [fgottschalk](http://github.com/fgottschalk), [Anastasia Kobzar](http://github.com/rikkalo), [Bilguun Ochirbat](http://github.com/bilguun0203), [Lesha Koss](http://github.com/leshakoss), [YuLe](http://github.com/yuler) and [guyroberts21](http://github.com/guyroberts21).
601
602### Fixed
603
604- [Made `formatDistanceStrict` and `formatDistanceToNowStrict` always return `1 year` instead of `12 months`.](https://github.com/date-fns/date-fns/pull/2391) ([#2388](https://github.com/date-fns/date-fns/issues/2388))
605
606- Fixed `nextDay`, `nextMonday` and `nextTuesday` missing in exports and type definitions. ([#2325](https://github.com/date-fns/date-fns/issues/2325))
607
608- [Fixed a DST bug in `formatDistanceStrict`.](https://github.com/date-fns/date-fns/pull/2329) ([#2307](https://github.com/date-fns/date-fns/issues/2307))
609
610### Added
611
612- [Added new `eachMinuteOfInterval` function.](https://github.com/date-fns/date-fns/pull/2382)
613
614- [Added Albanian (`sq`) locale](https://github.com/date-fns/date-fns/pull/2290)
615
616- [Added Mongolian (`mn`) locale](https://github.com/date-fns/date-fns/pull/1961)
617
618- [Added `nextWednesday`, `nextThursday`, `nextFriday`, `nextSaturday` and `nextSunday`.](https://github.com/date-fns/date-fns/pull/2291)
619
620## v2.19.0 - 2021-03-05
621
622[Tan75](http://github.com/tan75) worked on this release.
623
624### Fixed
625
626- [Assigned the correct `firstWeekContainsDate` value (`4`) for the French locale.](https://github.com/date-fns/date-fns/pull/2273) ([#2148](https://github.com/date-fns/date-fns/issues/2148))
627
628- [Fixed torsdag abbreviation in the Swedish locale.](https://github.com/date-fns/date-fns/pull/2220)
629
630- [Fixed a bug in `differenceInMonths` and `intervalToDuration` that occurs when dealing with the 28th of February.](https://github.com/date-fns/date-fns/pull/2256) ([#2255](https://github.com/date-fns/date-fns/issues/2255))
631
632### Added
633
634- [Added new functions: `nextDay`, `nextMonday` and `nextTuesday` that allows getting the next day of the week, Monday or Tuesday respectively.](https://github.com/date-fns/date-fns/pull/2214)
635
636## v2.18.0 - 2021-03-01
637
638Thanks to [Tan75](http://github.com/tan75) and [Lesha Koss](http://github.com/leshakoss).
639
640### Fixed
641
642- [Fixed documentation missing for `intlFormat`.](https://github.com/date-fns/date-fns/pull/2259) ([#2258](https://github.com/date-fns/date-fns/issues/2258))
643
644- [Fixed date formats in the Latvian locale.](https://github.com/date-fns/date-fns/pull/2205) ([#2202](https://github.com/date-fns/date-fns/issues/2202))
645
646### Added
647
648- [Added support of positive and negative offsets in `parseJSON`.](https://github.com/date-fns/date-fns/pull/2200) ([#2149](https://github.com/date-fns/date-fns/issues/2149))
649
650## [2.17.0] - 2021-02-05
651
652Kudos to [@shaykav](https://github.com/date-fns/date-fns/pull/1952), [@davidgape89](https://github.com/davidgape89), [@rikkalo](https://github.com/rikkalo), [@tan75](https://github.com/tan75), [@talgautb](https://github.com/talgautb), [@owenl131](https://github.com/owenl131), [@kylesezhi](https://github.com/kylesezhi), [@inigoiparragirre](https://github.com/inigoiparragirre), [@gius](https://github.com/gius), [@Endeauvirr](https://github.com/Endeauvirr) and [@frankyston](https://github.com/frankyston).
653
654### Fixed
655
656- [Fixed Russian locale parsing issue](https://github.com/date-fns/date-fns/pull/1950).
657
658- [Fixed `differenceInMonths` for edge cases, such as the end of February dates](https://github.com/date-fns/date-fns/pull/2185).
659
660- [Fixed suffixes for the Kazakh locale](https://github.com/date-fns/date-fns/pull/2010).
661
662- [Fixed `formatDuration` week translation in `pt` and `pt-BR` locales](https://github.com/date-fns/date-fns/pull/2125).
663
664- [Made Japanese locale to use the correct value for the start of the week](https://github.com/date-fns/date-fns/pull/2099).
665
666- [Adjusted date formats in the Basque locale](https://github.com/date-fns/date-fns/pull/2080).
667
668- [Fixed the short and medium date formats in the Czech locale](https://github.com/date-fns/date-fns/pull/2111).
669
670- [Adjusted the Polish translations of `formatDistance`](https://github.com/date-fns/date-fns/pull/2187).
671
672- [Fixed the week's abbreviations in the Brazilian Portuguese](https://github.com/date-fns/date-fns/pull/2170).
673
674### Added
675
676- [Added `intlFormat`](https://github.com/date-fns/date-fns/pull/2172) a lightweight formatting function that uses [Intl API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl). Eventually, it will become the default formatting function, so it's highly recommended for new code.
677
678- [Added `en-ZA` locale](https://github.com/date-fns/date-fns/pull/1952).
679
680- [Added an ability to format lowercase am/pm with `aaa` and `bbb` tokens](https://github.com/date-fns/date-fns/pull/2016).
681
682- [Added ordinal formatting for Japanese year values](https://github.com/date-fns/date-fns/pull/2177/files).
683
684## [2.16.1] - 2020-07-31
685
686Kudos to [@aleksaps](https://github.com/aleksaps), [@leedriscoll](https://github.com/leedriscoll) and [@BanForFun](https://github.com/BanForFun) for pull-requests!
687
688### Fixed
689
690- [Fixed a typo in Scottish Gaelic (gd) locale](https://github.com/date-fns/date-fns/pull/1925).
691- [Fixed typos in Serbian Latin locale](https://github.com/date-fns/date-fns/pull/1928).
692- [Fixed greek grammar for Saturday on `formatRelative`](https://github.com/date-fns/date-fns/pull/1930).
693- Removed locale snapshots from the npm package making it lighter.
694
695## [2.16.0] - 2020-08-27
696
697Kudos to [@jvpelt](https://github.com/jvpelt), [@piotrl](https://github.com/piotrl), [@yotamofek](https://github.com/yotamofek), [@dwaxweiler](https://github.com/dwaxweiler), [@leedriscoll](https://github.com/leedriscoll) and [@bradevans](https://github.com/bradevans) for working on the release. Also thanks to [@PascalHonegger](https://github.com/PascalHonegger), [@pickfire](https://github.com/pickfire), [@TheJaredWilcurt](https://github.com/TheJaredWilcurt), [@SidKH](https://github.com/SidKH) and [@nfantone](https://github.com/nfantone) for improving the documentation.
698
699### Fixed
700
701- [Added correct translations for Welsh `1 minute` and `2 days`](https://github.com/date-fns/date-fns/pull/1903).
702- [Fixed `formatRFC3339` formatting timezone offset with minutes](https://github.com/date-fns/date-fns/pull/1890).
703- [Added missing locale type definition for `formatDuration`](https://github.com/date-fns/date-fns/pull/1881)
704- [Fixed Scottish Gaelic locale issues](https://github.com/date-fns/date-fns/pull/1914).
705
706### Changed
707
708- [Used shorter Hebrew alternative for "about"](https://github.com/date-fns/date-fns/pull/1893).
709- [Improved string arguments warning after upgrading to v2](https://github.com/date-fns/date-fns/pull/1910).
710
711### Added
712
713- [Added Luxembourgish (lb) locale](https://github.com/date-fns/date-fns/pull/1900).
714
715## [2.15.0] - 2020-07-17
716
717Thanks to [@belgamo](https://github.com/belgamo), [@Matsuuu](https://github.com/Matsuuu), [@Imballinst](https://github.com/Imballinst), [@arsnyder16](https://github.com/arsnyder16), [@pankajupadhyay29](https://github.com/pankajupadhyay29), [@DCBN](https://github.com/DCBN), [@leedriscoll](https://github.com/leedriscoll), [@gottsohn](https://github.com/gottsohn), [@mukuljainx](https://github.com/mukuljainx) and [@dtriana](https://github.com/dtriana) for working on the release. Also kudos to [@KidkArolis](https://github.com/KidkArolis), [@imgx64](https://github.com/imgx64), [@fjc0k](https://github.com/fjc0k), [@wmonk](https://github.com/wmonk), [@djD-REK](https://github.com/djD-REK), [@dandv](https://github.com/dandv), [@psimk](https://github.com/psimk) and [@brimworks](https://github.com/brimworks) for improving the documentation.
718
719### Fixed
720
721- [Fixed behavior of `addBusinessDays` when input date is a weekend day](https://github.com/date-fns/date-fns/pull/1790).
722- [Fixed `parseISO` not returning `Invalid Date` on incorrect string when there are spaces in it](https://github.com/date-fns/date-fns/pull/1791).
723- [Fixed `es` round-tripping dates with Wednesday](https://github.com/date-fns/date-fns/pull/1792).
724- [Fixed round-trip bug with `d`/`EEEE` ordering in tokens like `PPPPP`](https://github.com/date-fns/date-fns/pull/1795).
725- [Fixed issues with parsing values in Japanese](https://github.com/date-fns/date-fns/pull/1807).
726- [Fixed Hungarian breaking IE11](https://github.com/date-fns/date-fns/pull/1842).
727- [Fixed Spanish accents in Saturday and Wednesday](https://github.com/date-fns/date-fns/pull/1872).
728
729### Changed
730
731- [Improved the message of protected tokens error](https://github.com/date-fns/date-fns/pull/1641).
732
733### Added
734
735- [Added Swiss-French `fr-CH` locale](https://github.com/date-fns/date-fns/pull/1809).
736- [Added Flemish `nl-BE` locale](https://github.com/date-fns/date-fns/pull/1812).
737- [Added Scottish Gaelic `gd` locale](https://github.com/date-fns/date-fns/pull/1832).
738- [Added New Zealand English `en-NZ` locale](https://github.com/date-fns/date-fns/pull/1835).
739- [Added `isMatch` function](https://github.com/date-fns/date-fns/pull/1868).
740
741## [2.14.0] - 2020-05-18
742
743Kudos to [@julamb](https://github.com/julamb), [@JacobSoderblom](https://github.com/JacobSoderblom), [@justingrant](http://github.com/justingrant), [@dragunoff](https://github.com/dragunoff), [@jmate0321](https://github.com/jmate0321), [@gbhasha](https://github.com/gbhasha), [@rasck](https://github.com/rasck), [@AlbertoPdRF](https://github.com/AlbertoPdRF), [@sebastianhaberey](https://github.com/sebastianhaberey) and [@giogonzo](https://github.com/giogonzo) for working on the release!
744
745### Fixed
746
747- [Fixed DST issues with `add`, `addDays` and `addMonths`](https://github.com/date-fns/date-fns/pull/1760).
748- [Fixed "quarter" translation in the Bulgarian locale](https://github.com/date-fns/date-fns/pull/1763).
749- [Fixed `formatDistance` strings in the Hungarian locale](https://github.com/date-fns/date-fns/pull/1765).
750- [Fixed Danish month abbreviations](https://github.com/date-fns/date-fns/pull/1774).
751- [Fixed parsing of mei in the Dutch locale](https://github.com/date-fns/date-fns/pull/1774).
752- [Fixed missing preposition in `formatLong` in the Spanish locale](https://github.com/date-fns/date-fns/pull/1775).
753- [Fixed `formatRelative` in the Italian locale](https://github.com/date-fns/date-fns/pull/1777).
754
755### Added
756
757- [Added `eachQuarterOfInterval`](https://github.com/date-fns/date-fns/pull/1715).
758- [Added Basque (`eu`) locale](https://github.com/date-fns/date-fns/pull/1759).
759- [Added Indian English (`en-IN`) locale](https://github.com/date-fns/date-fns/pull/1767).
760- [Added `eachHourOfInterval`](https://github.com/date-fns/date-fns/pull/1776).
761
762## [2.13.0] - 2020-05-06
763
764Thanks to [@JorenVos](https://github.com/JorenVos), [@developergouli](https://github.com/developergouli), [@rhlowe](https://github.com/rhlowe) and [@justingrant](http://github.com/justingrant) for working on the release!
765
766### Fixed
767
768- [Fixed mei abbreviation in the Dutch locale](https://github.com/date-fns/date-fns/pull/1752).
769- [Fixed `differenceInDays` DST behavior broken in 2.12.0](https://github.com/date-fns/date-fns/pull/1754).
770
771### Added
772
773- [Added Kannada locale support](https://github.com/date-fns/date-fns/pull/1747).
774- [Added `formatISODuration` function](https://github.com/date-fns/date-fns/pull/1713).
775- [Added `intervalToDuration` function](https://github.com/date-fns/date-fns/pull/1713).
776
777## [2.12.0] - 2020-04-09
778
779Kudos to [@leshakoss](http://github.com/leshakoss), [@skyuplam](https://github.com/skyuplam), [@so99ynoodles](https://github.com/so99ynoodles), [@dkozickis](https://github.com/dkozickis), [@belgamo](https://github.com/belgamo), [@akgondber](https://github.com/akgondber), [@dcousens](https://github.com/dcousens) and [@BoomDev](https://github.com/BoomDev) for working on the release!
780
781### Fixed
782
783- [Fixed minulý štvrtok in Slovak locale](https://github.com/date-fns/date-fns/pull/1701).
784- Fixed date ordinalNumber for [ja/zh-CN/zh-TW](https://github.com/date-fns/date-fns/pull/1690) and [ko](https://github.com/date-fns/date-fns/pull/1696).
785- [Fixed quarters parsing](https://github.com/date-fns/date-fns/pull/1694).
786- [Fixed `setDay` with `weekStartsOn` != 0](https://github.com/date-fns/date-fns/pull/1639).
787- [Fixed differenceInDays across DST](https://github.com/date-fns/date-fns/pull/1630).
788- [Fixed required arguments exception message](https://github.com/date-fns/date-fns/pull/1674).
789
790### Added
791
792- [Added new function `formatDistanceToNowStrict`](https://github.com/date-fns/date-fns/pull/1679).
793
794## [2.11.1] - 2020-03-26
795
796### Fixed
797
798- Rebuilt TypeScript and flow types.
799
800## [2.11.0] - 2020-03-13
801
802Kudos to [@oakhan3](https://github.com/oakhan3), [@Mukhammadali](https://github.com/Mukhammadali), [@altrim](https://github.com/altrim), [@leepowellcouk](https://github.com/leepowellcouk), [@amatzon](@https://github.com/amatzon), [@bryanMt](https://github.com/bryanMt), [@kalekseev](https://github.com/kalekseev), [@eugene-platov](https://github.com/eugene-platov) and [@tjrobinson](https://github.com/tjrobinson) for working on the release.
803
804### Fixed
805
806- [Fixed a bug in `differenceInYears` causing incorrect results when the left date is a leap day](https://github.com/date-fns/date-fns/pull/1654).
807- [Fixed `parseISO` to work correctly around time shift dates](https://github.com/date-fns/date-fns/pull/1667).
808- [Fixed `format` to work correctly with GMT-0752/GMT-0456 and similar timezones](https://github.com/date-fns/date-fns/pull/1666).
809
810### Changed
811
812- [Changed `getDay` typings to return `0|1|2|3|4|5|6` instead of `number`](https://github.com/date-fns/date-fns/pull/1668).
813- [Improved Chinese locale](https://github.com/date-fns/date-fns/pull/1664):
814 - Change date format to meet the national standard (GB/T 7408-2005).
815 - Improve `ordinalNumber` function behavior.
816 - Add prefix in `formatRelative` depending on if it's a current week or not.
817
818### Added
819
820- [Added Uzbek `uz` locale](https://github.com/date-fns/date-fns/pull/1648).
821- [Updated Macedonian locale for v2](https://github.com/date-fns/date-fns/pull/1649).
822- [Added Maltese `mt` locale](https://github.com/date-fns/date-fns/pull/1658).
823
824## [2.10.0] - 2020-02-25
825
826### Fixed
827
828- [Fixed `formatISO` when formatting time with timezones with minute offsets > 0](https://github.com/date-fns/date-fns/pull/1599). Kudos to [@dcRUSTy](https://github.com/dcRUSTy).
829
830### Fixed
831
832- Fixed a bug in setDay when using weekStartsOn that is not 0
833
834### Added
835
836- [Added `weeks` to `Duration`](https://github.com/date-fns/date-fns/pull/1592).
837- [Added `weeks` support to `add` and `sub`](https://github.com/date-fns/date-fns/pull/1592).
838- [Added details message in `throwProtectedError`](https://github.com/date-fns/date-fns/pull/1592).
839
840## [2.9.0] - 2020-01-08
841
842Thanks to [@mborgbrant](https://github.com/mborgbrant), [@saintplay](https://github.com/saintplay), [@mrenty](https://github.com/mrenty), [@kibertoad](https://github.com/kibertoad), [@levibuzolic](https://github.com/levibuzolic), [@Anshuman71](https://github.com/Anshuman71), [@talgautb](https://github.com/talgautb), [@filipjuza](https://github.com/filipjuza), [@tobyzerner](https://github.com/tobyzerner), [@emil9453](https://github.com/emil9453), [@fintara](https://github.com/fintara), [@pascaliske](https://github.com/pascaliske), [@rramiachraf](https://github.com/rramiachraf), [@marnusw](https://github.com/marnusw) and [@Imballinst](https://github.com/Imballinst) for working on the release.
843
844### Fixed
845
846- [Fixed a bug with addBusinessDays returning the Tuesday when adding 1 day on weekends. Now it returns the Monday](https://github.com/date-fns/date-fns/pull/1588).
847- [Added missing timezone to `formatISO`](https://github.com/date-fns/date-fns/pull/1576).
848- [Removed dots from short day period names in the Kazakh locale](https://github.com/date-fns/date-fns/pull/1512).
849- [Fixed typo in formatDistance in the Czech locale](https://github.com/date-fns/date-fns/pull/1540).
850- [Fixed shortenings in the Bulgarian locale](https://github.com/date-fns/date-fns/pull/1560).
851- [Fixed regex for the May in the Portuguese locale](https://github.com/date-fns/date-fns/pull/1565).
852
853### Added
854
855- [Added `eachMonthOfInterval` and `eachYearOfInterval`](https://github.com/date-fns/date-fns/pull/618).
856- [Added `inclusive` option to `areIntervalsOverlapping](https://github.com/date-fns/date-fns/pull/643).
857- [Added `isExists` function that checks if the given date is exists](https://github.com/date-fns/date-fns/pull/682).
858- [Added `add` function to add seconds, minutes, hours, weeks, years in single call](https://github.com/date-fns/date-fns/pull/1581).
859- [Added `sub` function, the opposite of `add`](https://github.com/date-fns/date-fns/pull/1583).
860- [Added `Duration` type used in `add` and `sub`](https://github.com/date-fns/date-fns/pull/1583).
861- [Added Azerbaijani (az) locale](https://github.com/date-fns/date-fns/pull/1547).
862- [Added Moroccan Arabic (ar-MA) locale](https://github.com/date-fns/date-fns/pull/1578).
863
864### Changed
865
866- [Reduced the total minified build size by 1Kb/4%](https://github.com/date-fns/date-fns/pull/1563).
867- [Made all properties in `Locale` type optional](https://github.com/date-fns/date-fns/pull/1542).
868- [Added missing properties to `Locale` type](https://github.com/date-fns/date-fns/pull/1542).
869- [Add the locale code to `Locale` type](https://github.com/date-fns/date-fns/pull/1580).
870- [Added support of space time separator to `parseJSON`](https://github.com/date-fns/date-fns/pull/1579).
871- [Allowed up to 7 digits in milliseconds in `parseJSON`](https://github.com/date-fns/date-fns/pull/1579).
872
873## [2.8.1] - 2019-11-22
874
875Thanks to [@Imballinst](https://github.com/Imballinst) for the bug fix!
876
877### Fixed
878
879- [Add colon between the hour and minutes for `formatRFC3339`](https://github.com/date-fns/date-fns/pull/1549). [See #1548](https://github.com/date-fns/date-fns/issues/1548).
880
881## [2.8.0] - 2019-11-19
882
883Kudos to [@NaridaL](https://github.com/NaridaL), [@Zyten](https://github.com/Zyten), [@Imballinst](https://github.com/Imballinst), [@leshakoss](https://github.com/leshakoss) and [@Neorth](https://github.com/Neorth) for working on the release.
884
885### Fixed
886
887- [Remove the next week preposition in the Swedish locale](https://github.com/date-fns/date-fns/pull/1538).
888
889### Added
890
891- [Added Malay (ms) locale](https://github.com/date-fns/date-fns/pull/1537).
892- [Added `formatISO`, `formatISO9075`, `formatRFC3339`, and `formatRFC7231` functions](https://github.com/date-fns/date-fns/pull/1536).
893
894## [2.7.0] - 2019-11-07
895
896Thanks to [@mzgajner](https://github.com/mzgajner), [@NaridaL](https://github.com/NaridaL), [@Zyten](https://github.com/Zyten), [@leshakoss](https://github.com/leshakoss), [@fintara](https://github.com/fintara), [@kpr-hellofresh](https://github.com/kpr-hellofresh) for contributing to the release.
897
898### Fixed
899
900- [Fixed a mistake in the Slovenian locale](https://github.com/date-fns/date-fns/pull/1529).
901- [Fixed incorrect behavior of `parseISO` in Firefox caused by differences in `getTimezoneOffset`](https://github.com/date-fns/date-fns/pull/1495).
902
903### Changed
904
905- [Make object arguments types more elaborate in Flow type definitions](https://github.com/date-fns/date-fns/pull/1519).
906- [Get rid of deprecated Function in Flow type definitions](https://github.com/date-fns/date-fns/pull/1520).
907- [Allow `parseJSON` to accept strings without trailing 'Z' symbol and with up to 6 digits in the milliseconds' field](https://github.com/date-fns/date-fns/pull/1499).
908
909### Added
910
911- [Added Bulgarian (bg) locale](https://github.com/date-fns/date-fns/pull/1522).
912
913## [2.6.0] - 2019-10-22
914
915Kudos to [@marnusw](https://github.com/marnusw), [@cdrikd](https://github.com/cdrikd) and [@rogyvoje](https://github.com/rogyvoje) for working on the release!
916
917### Added
918
919- [Added `parseJSON` - lightweight function (just 411 B) that parses dates formatted with `toJSON`](https://github.com/date-fns/date-fns/pull/1463).
920- [Added the language code to each locale](https://github.com/date-fns/date-fns/pull/1489).
921- [Added `subBusinessDays` function](https://github.com/date-fns/date-fns/pull/1491).
922- [Added both Serbian - cyrillic (sr) and latin (sr-Latn) locales](https://github.com/date-fns/date-fns/pull/1494).
923
924## [2.5.1] - 2019-10-18
925
926Thanks to [@mitchellbutler](https://github.com/mitchellbutler) for the bug fix!
927
928### Fixed
929
930- [Fixed infinite loop in `addBusinessDays`](https://github.com/date-fns/date-fns/pull/1486).
931
932## [2.5.0] - 2019-10-16
933
934Kudos to [@dkozickis](https://github.com/dkozickis), [@drugoi](https://github.com/drugoi), [@kranthilakum](https://github.com/kranthilakum), [@102](https://github.com/102), [@gpetrioli](https://github.com/gpetrioli) and [@JulienMalige](https://github.com/JulienMalige) for making the release happen.
935
936### Fixed
937
938- [Fixed compatibility with IE11 by removing `findIndex` from the code](https://github.com/date-fns/date-fns/pull/1457).
939- [Fixed Greek locale patterns](https://github.com/date-fns/date-fns/pull/1480).
940
941### Added
942
943- [Added Kazakh (kk) locale](https://github.com/date-fns/date-fns/pull/1460).
944- [Added Telugu (te) locale](https://github.com/date-fns/date-fns/pull/1464).
945- [Added Canadian French (fr-CA) locale](https://github.com/date-fns/date-fns/issues/1465).
946- [Added Australian English (en-AU) locale](https://github.com/date-fns/date-fns/pull/1470).
947- [Exported `Interval` and `Locale` types from Flow typings](https://github.com/date-fns/date-fns/pull/1475).
948
949## [2.4.1] - 2019-09-28
950
951Thanks to [@mrclayman](https://github.com/mrclayman) for reporting the issue and [@leshakoss](https://github.com/leshakoss) for fixing it.
952
953### Fixed
954
955- [Fixed am/pm mixup in the Czech locale](https://github.com/date-fns/date-fns/pull/1453).
956
957## [2.4.0] - 2019-09-27
958
959This release is brought to you by these amazing people: [@lovelovedokidoki](https://github.com/lovelovedokidoki), [@alexigityan](https://github.com/alexigityan), [@kalekseev](https://github.com/kalekseev) and [@andybangs](https://github.com/andybangs). You rock!
960
961### Fixed
962
963- [Fixed Vietnamese parsing patterns](https://github.com/date-fns/date-fns/pull/1445).
964- [Fixed Czech parsing regexes](https://github.com/date-fns/date-fns/pull/1446).
965- [Fixed offset for Eastern Hemisphere in `parseISO`](https://github.com/date-fns/date-fns/pull/1450).
966
967### Added
968
969- [Added Armenian locale support](https://github.com/date-fns/date-fns/pull/1448).
970
971## [2.3.0] - 2019-09-24
972
973Huge thanks to [@lovelovedokidoki](https://github.com/lovelovedokidoki) who improved 8 (!) locales in an unstoppable open-source rampage and [@VesterDe](https://github.com/VesterDe) for fixing Slovenian locale 👏
974
975### Fixed
976
977- [Fixed the translation of "yesterday" in the Slovenian locale](https://github.com/date-fns/date-fns/pull/1420).
978- [Fixed French parsing issues with June and August](https://github.com/date-fns/date-fns/pull/1430).
979- [Improved Turkish parsing](https://github.com/date-fns/date-fns/pull/1432).
980- [Fixed "March" in Dutch parsing patterns](https://github.com/date-fns/date-fns/pull/1433).
981- [Fixed Hindi parsing patterns](https://github.com/date-fns/date-fns/pull/1434).
982
983### Added
984
985- [Added Finnish matching patterns](https://github.com/date-fns/date-fns/pull/1425).
986- [Accept abbreviated March, June, July in Norwegian locales](https://github.com/date-fns/date-fns/pull/1431).
987- [Added parsing for Greek months with long formatting](https://github.com/date-fns/date-fns/pull/1435).
988
989## [2.2.1] - 2019-09-12
990
991Kudos to date-fns contributors: [@mzgajner](https://github.com/mzgajner), [@sibiraj-s](https://github.com/sibiraj-s), [@mukeshmandiwal](https://github.com/mukeshmandiwal), [@SneakyFish5](https://github.com/SneakyFish5) and [@CarterLi](https://github.com/CarterLi).
992
993### Added
994
995- [Added new `set` function](https://github.com/date-fns/date-fns/pull/1398).
996- [Updated Slovenian (sl) locale for v2](https://github.com/date-fns/date-fns/pull/1418).
997- [Added Tamil (ta) locale](https://github.com/date-fns/date-fns/pull/1411).
998- [Added Hindi (hi) locale](https://github.com/date-fns/date-fns/pull/1409).
999- [Added support of `\n` in `format`, `lightFormat` and `parse`](https://github.com/date-fns/date-fns/pull/1417).
1000
1001## [2.1.0] - 2019-09-06
1002
1003Thanks to date-fns contributors: [@ManadayM](https://github.com/ManadayM), [@illuminist](https://github.com/illuminist), [@visualfanatic](https://github.com/visualfanatic), [@vsaarinen](https://github.com/vsaarinen) and at last but not the least [@leshakoss](https://github.com/leshakoss)!
1004
1005### Fixed
1006
1007- [Set start of the week to Sunday for Thai locale](https://github.com/date-fns/date-fns/pull/1402).
1008- [Fixed month matching in Polish locale](https://github.com/date-fns/date-fns/pull/1404).
1009- [Fixed `eachWeekendOfInterval` skipping the first date in the supplied interval](https://github.com/date-fns/date-fns/pull/1407).
1010
1011### Added
1012
1013- [Added Gujarati locale](https://github.com/date-fns/date-fns/pull/1400).
1014
1015## [2.0.1] - 2019-08-23
1016
1017### Fixed
1018
1019- [Fix](https://github.com/date-fns/date-fns/pull/1046) `getWeekOfMonth` with `options.weekStartsOn` set to 1 [not working for Sundays](https://github.com/date-fns/date-fns/issues/1040). Kudos to [@waseemahmad31](https://github.com/waseemahmad31)!
1020
1021## [2.0.0] - 2019-08-20
1022
1023If you're upgrading from v2 alpha or beta, [see the pre-release changelog](https://gist.github.com/kossnocorp/a307a464760b405bb78ef5020a4ab136).
1024
1025### Fixed
1026
1027- Fixed the `toDate` bug occurring when parsing ISO-8601 style dates (but not valid ISO format)
1028 with a trailing Z (e.g `2012-01Z`), it returned Invalid Date for FireFox/IE11 [#510](https://github.com/date-fns/date-fns/issue/510)
1029
1030- Fixed `differenceIn...` functions returning negative zero in some cases:
1031 [#692](https://github.com/date-fns/date-fns/issues/692)
1032
1033- `isDate` now works properly with dates passed across iframes [#754](https://github.com/date-fns/date-fns/pull/754).
1034
1035- Fixed a few bugs that appeared in timezones with offsets that include seconds (e.g. GMT+00:57:44).
1036 See PR [#789](https://github.com/date-fns/date-fns/pull/789).
1037
1038- [Fixed DST issue](https://github.com/date-fns/date-fns/pull/1003). See [#972](https://github.com/date-fns/date-fns/issues/972) and [#992](https://github.com/date-fns/date-fns/issues/992) for more details.
1039
1040- Fixed DST issue in `eachDayOfInterval` that caused time in the days
1041 after DST change to have the shift as well.
1042
1043- Fixed bug in Galician locale caused by incorrect usage of `getHours`
1044 instead of `getUTCHours`.
1045
1046### Changed
1047
1048- **BREAKING**: now functions don't accept string arguments, but only
1049 numbers or dates. When a string is passed, it will result in
1050 an unexpected result (`Invalid Date`, `NaN`, etc).
1051
1052 From now on a string should be parsed using `parseISO` (ISO 8601)
1053 or `parse`.
1054
1055 In v1 we've used `new Date()` to parse strings, but it resulted in many
1056 hard-to-track bugs caused by inconsistencies in different browsers.
1057 To address that we've implemented our ISO 8601 parser but that made
1058 library to significantly grow in size. To prevent inevitable bugs
1059 and keep the library tiny, we made this trade-off.
1060
1061 See [this post](https://blog.date-fns.org/post/we-cut-date-fns-v2-minimal-build-size-down-to-300-bytes-and-now-its-the-smallest-date-library-18f2nvh2z0yal) for more details.
1062
1063 ```javascript
1064 // Before v2.0.0
1065 addDays("2016-01-01", 1);
1066
1067 // v2.0.0 onward
1068 addDays(parseISO("2016-01-01"), 1);
1069 ```
1070
1071- **BREAKING**: new format string API for `format` function
1072 which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
1073 See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
1074
1075 | Unit | v2 Pattern | v1 Pattern | Result examples |
1076 | ------------------------------- | ---------- | ---------- | --------------------------------- |
1077 | Era | G..GGG | | AD, BC |
1078 | | GGGG | | Anno Domini, Before Christ |
1079 | | GGGGG | | A, B |
1080 | Calendar year | y | | 44, 1, 1900, 2017 |
1081 | | yo | | 44th, 1st, 0th, 17th |
1082 | | yy | YY | 44, 01, 00, 17 |
1083 | | yyy | | 044, 001, 1900, 2017 |
1084 | | yyyy | YYYY | 0044, 0001, 1900, 2017 |
1085 | | yyyyy | | ... |
1086 | Local week-numbering year | Y | | 44, 1, 1900, 2017 |
1087 | | Yo | | 44th, 1st, 1900th, 2017th |
1088 | | YY | | 44, 01, 00, 17 |
1089 | | YYY | | 044, 001, 1900, 2017 |
1090 | | YYYY | | 0044, 0001, 1900, 2017 |
1091 | | YYYYY | | ... |
1092 | ISO week-numbering year | R | | -43, 0, 1, 1900, 2017 |
1093 | | RR | GG | -43, 00, 01, 1900, 2017 |
1094 | | RRR | | -043, 000, 001, 1900, 2017 |
1095 | | RRRR | GGGG | -0043, 0000, 0001, 1900, 2017 |
1096 | | RRRRR | | ... |
1097 | Extended year | u | | -43, 0, 1, 1900, 2017 |
1098 | | uu | | -43, 01, 1900, 2017 |
1099 | | uuu | | -043, 001, 1900, 2017 |
1100 | | uuuu | | -0043, 0001, 1900, 2017 |
1101 | | uuuuu | | ... |
1102 | Quarter (formatting) | Q | | 1, 2, 3, 4 |
1103 | | Qo | | 1st, 2nd, 3rd, 4th |
1104 | | QQ | | 01, 02, 03, 04 |
1105 | | QQQ | | Q1, Q2, Q3, Q4 |
1106 | | QQQQ | | 1st quarter, 2nd quarter, ... |
1107 | | QQQQQ | | 1, 2, 3, 4 |
1108 | Quarter (stand-alone) | q | Q | 1, 2, 3, 4 |
1109 | | qo | Qo | 1st, 2nd, 3rd, 4th |
1110 | | qq | | 01, 02, 03, 04 |
1111 | | qqq | | Q1, Q2, Q3, Q4 |
1112 | | qqqq | | 1st quarter, 2nd quarter, ... |
1113 | | qqqqq | | 1, 2, 3, 4 |
1114 | Month (formatting) | M | | 1, 2, ..., 12 |
1115 | | Mo | | 1st, 2nd, ..., 12th |
1116 | | MM | | 01, 02, ..., 12 |
1117 | | MMM | | Jan, Feb, ..., Dec |
1118 | | MMMM | | January, February, ..., December |
1119 | | MMMMM | | J, F, ..., D |
1120 | Month (stand-alone) | L | M | 1, 2, ..., 12 |
1121 | | Lo | | 1st, 2nd, ..., 12th |
1122 | | LL | MM | 01, 02, ..., 12 |
1123 | | LLL | MMM | Jan, Feb, ..., Dec |
1124 | | LLLL | MMMM | January, February, ..., December |
1125 | | LLLLL | | J, F, ..., D |
1126 | Local week of year | w | | 1, 2, ..., 53 |
1127 | | wo | | 1st, 2nd, ..., 53th |
1128 | | ww | | 01, 02, ..., 53 |
1129 | ISO week of year | I | W | 1, 2, ..., 53 |
1130 | | Io | Wo | 1st, 2nd, ..., 53th |
1131 | | II | WW | 01, 02, ..., 53 |
1132 | Day of month | d | D | 1, 2, ..., 31 |
1133 | | do | Do | 1st, 2nd, ..., 31st |
1134 | | dd | DD | 01, 02, ..., 31 |
1135 | Day of year | D | DDD | 1, 2, ..., 365, 366 |
1136 | | Do | DDDo | 1st, 2nd, ..., 365th, 366th |
1137 | | DD | | 01, 02, ..., 365, 366 |
1138 | | DDD | DDDD | 001, 002, ..., 365, 366 |
1139 | | DDDD | | ... |
1140 | Day of week (formatting) | E..EEE | | Mon, Tue, Wed, ..., Su |
1141 | | EEEE | | Monday, Tuesday, ..., Sunday |
1142 | | EEEEE | | M, T, W, T, F, S, S |
1143 | | EEEEEE | | Mo, Tu, We, Th, Fr, Sa, Su |
1144 | ISO day of week (formatting) | i | E | 1, 2, 3, ..., 7 |
1145 | | io | do | 1st, 2nd, ..., 7th |
1146 | | ii | | 01, 02, ..., 07 |
1147 | | iii | ddd | Mon, Tue, Wed, ..., Su |
1148 | | iiii | dddd | Monday, Tuesday, ..., Sunday |
1149 | | iiiii | | M, T, W, T, F, S, S |
1150 | | iiiiii | dd | Mo, Tu, We, Th, Fr, Sa, Su |
1151 | Local day of week (formatting) | e | | 2, 3, 4, ..., 1 |
1152 | | eo | | 2nd, 3rd, ..., 1st |
1153 | | ee | | 02, 03, ..., 01 |
1154 | | eee | | Mon, Tue, Wed, ..., Su |
1155 | | eeee | | Monday, Tuesday, ..., Sunday |
1156 | | eeeee | | M, T, W, T, F, S, S |
1157 | | eeeeee | | Mo, Tu, We, Th, Fr, Sa, Su |
1158 | Local day of week (stand-alone) | c | | 2, 3, 4, ..., 1 |
1159 | | co | | 2nd, 3rd, ..., 1st |
1160 | | cc | | 02, 03, ..., 01 |
1161 | | ccc | | Mon, Tue, Wed, ..., Su |
1162 | | cccc | | Monday, Tuesday, ..., Sunday |
1163 | | ccccc | | M, T, W, T, F, S, S |
1164 | | cccccc | | Mo, Tu, We, Th, Fr, Sa, Su |
1165 | AM, PM | a..aaa | A | AM, PM |
1166 | | aaaa | aa | a.m., p.m. |
1167 | | aaaaa | | a, p |
1168 | AM, PM, noon, midnight | b..bbb | | AM, PM, noon, midnight |
1169 | | bbbb | | a.m., p.m., noon, midnight |
1170 | | bbbbb | | a, p, n, mi |
1171 | Flexible day period | B..BBB | | at night, in the morning, ... |
1172 | | BBBB | | at night, in the morning, ... |
1173 | | BBBBB | | at night, in the morning, ... |
1174 | Hour [1-12] | h | | 1, 2, ..., 11, 12 |
1175 | | ho | | 1st, 2nd, ..., 11th, 12th |
1176 | | hh | | 01, 02, ..., 11, 12 |
1177 | Hour [0-23] | H | | 0, 1, 2, ..., 23 |
1178 | | Ho | | 0th, 1st, 2nd, ..., 23rd |
1179 | | HH | | 00, 01, 02, ..., 23 |
1180 | Hour [0-11] | K | | 1, 2, ..., 11, 0 |
1181 | | Ko | | 1st, 2nd, ..., 11th, 0th |
1182 | | KK | | 1, 2, ..., 11, 0 |
1183 | Hour [1-24] | k | | 24, 1, 2, ..., 23 |
1184 | | ko | | 24th, 1st, 2nd, ..., 23rd |
1185 | | kk | | 24, 01, 02, ..., 23 |
1186 | Minute | m | | 0, 1, ..., 59 |
1187 | | mo | | 0th, 1st, ..., 59th |
1188 | | mm | | 00, 01, ..., 59 |
1189 | Second | s | | 0, 1, ..., 59 |
1190 | | so | | 0th, 1st, ..., 59th |
1191 | | ss | | 00, 01, ..., 59 |
1192 | Fraction of second | S | | 0, 1, ..., 9 |
1193 | | SS | | 00, 01, ..., 99 |
1194 | | SSS | | 000, 0001, ..., 999 |
1195 | | SSSS | | ... |
1196 | Timezone (ISO-8601 w/ Z) | X | | -08, +0530, Z |
1197 | | XX | | -0800, +0530, Z |
1198 | | XXX | | -08:00, +05:30, Z |
1199 | | XXXX | | -0800, +0530, Z, +123456 |
1200 | | XXXXX | | -08:00, +05:30, Z, +12:34:56 |
1201 | Timezone (ISO-8601 w/o Z) | x | | -08, +0530, +00 |
1202 | | xx | ZZ | -0800, +0530, +0000 |
1203 | | xxx | Z | -08:00, +05:30, +00:00 |
1204 | | xxxx | | -0800, +0530, +0000, +123456 |
1205 | | xxxxx | | -08:00, +05:30, +00:00, +12:34:56 |
1206 | Timezone (GMT) | O...OOO | | GMT-8, GMT+5:30, GMT+0 |
1207 | | OOOO | | GMT-08:00, GMT+05:30, GMT+00:00 |
1208 | Timezone (specific non-locat.) | z...zzz | | GMT-8, GMT+5:30, GMT+0 |
1209 | | zzzz | | GMT-08:00, GMT+05:30, GMT+00:00 |
1210 | Seconds timestamp | t | X | 512969520 |
1211 | | tt | | ... |
1212 | Milliseconds timestamp | T | x | 512969520900 |
1213 | | TT | | ... |
1214 | Long localized date | P | | 5/29/53 |
1215 | | PP | | May 29, 1453 |
1216 | | PPP | | May 29th, 1453 |
1217 | | PPPP | | Sunday, May 29th, 1453 |
1218 | Long localized time | p | | 12:00 AM |
1219 | | pp | | 12:00:00 AM |
1220 | | ppp | | 12:00:00 AM GMT+2 |
1221 | | pppp | | 12:00:00 AM GMT+02:00 |
1222 | Combination of date and time | Pp | | 5/29/53, 12:00 AM |
1223 | | PPpp | | May 29, 1453, 12:00 AM |
1224 | | PPPppp | | May 29th, 1453 at ... |
1225 | | PPPPpppp | | Sunday, May 29th, 1453 at ... |
1226
1227 Characters are now escaped using single quote symbols (`'`) instead of square brackets.
1228 `format` now throws RangeError if it encounters an unescaped latin character
1229 that isn't a valid formatting token.
1230
1231 To use `YY` and `YYYY` tokens that represent week-numbering years,
1232 you should set `useAdditionalWeekYearTokens` option:
1233
1234 ```javascript
1235 format(Date.now(), "YY", { useAdditionalWeekYearTokens: true });
1236 //=> '86'
1237 ```
1238
1239 To use `D` and `DD` tokens which represent days of the year,
1240 set `useAdditionalDayOfYearTokens` option:
1241
1242 ```javascript
1243 format(Date.now(), "D", { useAdditionalDayOfYearTokens: true });
1244 //=> '364'
1245 ```
1246
1247- **BREAKING**: function submodules now use camelCase naming schema:
1248
1249 ```javascript
1250 // Before v2.0.0
1251 import differenceInCalendarISOYears from "date-fns/difference_in_calendar_iso_years";
1252
1253 // v2.0.0 onward
1254 import differenceInCalendarISOYears from "date-fns/differenceInCalendarISOYears";
1255 ```
1256
1257- **BREAKING**: min and max functions now accept an array of dates
1258 rather than spread arguments.
1259
1260 ```javascript
1261 // Before v2.0.0
1262 var date1 = new Date(1989, 6 /* Jul */, 10);
1263 var date2 = new Date(1987, 1 /* Feb */, 11);
1264
1265 var minDate = min(date1, date2);
1266 var maxDate = max(date1, date2);
1267
1268 // v2.0.0 onward:
1269 var dates = [
1270 new Date(1989, 6 /* Jul */, 10),
1271 new Date(1987, 1 /* Feb */, 11),
1272 ];
1273
1274 var minDate = min(dates);
1275 var maxDate = max(dates);
1276 ```
1277
1278- **BREAKING**: make the second argument of `format` required for the sake of explicitness.
1279
1280 ```javascript
1281 // Before v2.0.0
1282 format(new Date(2016, 0, 1));
1283
1284 // v2.0.0 onward
1285 format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx");
1286 ```
1287
1288- **BREAKING** renamed ISO week-numbering year helpers:
1289
1290 - `addISOYears` → `addISOWeekYears`
1291 - `differenceInCalendarISOYears` → `differenceInCalendarISOWeekYears`
1292 - `differenceInISOYears` → `differenceInISOWeekYears`
1293 - `endOfISOYear` → `endOfISOWeekYear`
1294 - `getISOYear` → `getISOWeekYear`
1295 - `isSameISOYear` → `isSameISOWeekYear`
1296 - `lastDayOfISOYear` → `lastDayOfISOWeekYear`
1297 - `setISOYear` → `setISOWeekYear`
1298 - `subISOYears` → `subISOWeekYears`
1299
1300 i.e. "ISO year" renamed to "ISO week year", which is short for
1301 [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
1302 It makes them consistent with locale-dependent week-numbering year helpers,
1303 e.g., `startOfWeekYear`.
1304
1305- **BREAKING**: functions renamed:
1306
1307 - `areRangesOverlapping` → `areIntervalsOverlapping`
1308 - `eachDay` → `eachDayOfInterval`
1309 - `getOverlappingDaysInRanges` → `getOverlappingDaysInIntervals`
1310 - `isWithinRange` → `isWithinInterval`
1311
1312 This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
1313
1314 ```
1315 2.1.3
1316 time interval
1317 part of the time axis limited by two instants
1318 ```
1319
1320 Also these functions now accept an object with `start` and `end` properties
1321 instead of two arguments as an interval. All these functions
1322 throw `RangeError` if the start of the interval is after its end
1323 or if any date in the interval is `Invalid Date`.
1324
1325 ```javascript
1326 // Before v2.0.0
1327
1328 areRangesOverlapping(
1329 new Date(2014, 0, 10),
1330 new Date(2014, 0, 20),
1331 new Date(2014, 0, 17),
1332 new Date(2014, 0, 21),
1333 );
1334
1335 eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20));
1336
1337 getOverlappingDaysInRanges(
1338 new Date(2014, 0, 10),
1339 new Date(2014, 0, 20),
1340 new Date(2014, 0, 17),
1341 new Date(2014, 0, 21),
1342 );
1343
1344 isWithinRange(
1345 new Date(2014, 0, 3),
1346 new Date(2014, 0, 1),
1347 new Date(2014, 0, 7),
1348 );
1349
1350 // v2.0.0 onward
1351
1352 areIntervalsOverlapping(
1353 { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
1354 { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) },
1355 );
1356
1357 eachDayOfInterval({
1358 start: new Date(2014, 0, 10),
1359 end: new Date(2014, 0, 20),
1360 });
1361
1362 getOverlappingDaysInIntervals(
1363 { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
1364 { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) },
1365 );
1366
1367 isWithinInterval(new Date(2014, 0, 3), {
1368 start: new Date(2014, 0, 1),
1369 end: new Date(2014, 0, 7),
1370 });
1371 ```
1372
1373- **BREAKING**: functions renamed:
1374
1375 - `distanceInWords` → `formatDistance`
1376 - `distanceInWordsStrict` → `formatDistanceStrict`
1377 - `distanceInWordsToNow` → `formatDistanceToNow`
1378
1379 to make them consistent with `format` and `formatRelative`.
1380
1381- **BREAKING**: The order of arguments of `distanceInWords` and `distanceInWordsStrict`
1382 is swapped to make them consistent with `differenceIn...` functions.
1383
1384 ```javascript
1385 // Before v2.0.0
1386
1387 distanceInWords(
1388 new Date(1986, 3, 4, 10, 32, 0),
1389 new Date(1986, 3, 4, 11, 32, 0),
1390 { addSuffix: true },
1391 ); //=> 'in about 1 hour'
1392
1393 // v2.0.0 onward
1394
1395 formatDistance(
1396 new Date(1986, 3, 4, 11, 32, 0),
1397 new Date(1986, 3, 4, 10, 32, 0),
1398 { addSuffix: true },
1399 ); //=> 'in about 1 hour'
1400 ```
1401
1402- **BREAKING**: `partialMethod` option in `formatDistanceStrict` is renamed to `roundingMethod`.
1403
1404 ```javascript
1405 // Before v2.0.0
1406
1407 distanceInWordsStrict(
1408 new Date(1986, 3, 4, 10, 32, 0),
1409 new Date(1986, 3, 4, 10, 33, 1),
1410 { partialMethod: "ceil" },
1411 ); //=> '2 minutes'
1412
1413 // v2.0.0 onward
1414
1415 formatDistanceStrict(
1416 new Date(1986, 3, 4, 10, 33, 1),
1417 new Date(1986, 3, 4, 10, 32, 0),
1418 { roundingMethod: "ceil" },
1419 ); //=> '2 minutes'
1420 ```
1421
1422- **BREAKING**: in `formatDistanceStrict`, if `roundingMethod` is not specified,
1423 it now defaults to `round` instead of `floor`.
1424
1425- **BREAKING**: `unit` option in `formatDistanceStrict` now accepts one of the strings:
1426 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'
1427
1428 ```javascript
1429 // Before v2.0.0
1430
1431 distanceInWordsStrict(
1432 new Date(1986, 3, 4, 10, 32, 0),
1433 new Date(1986, 3, 4, 10, 33, 1),
1434 { unit: "m" },
1435 );
1436
1437 // v2.0.0 onward
1438
1439 formatDistanceStrict(
1440 new Date(1986, 3, 4, 10, 33, 1),
1441 new Date(1986, 3, 4, 10, 32, 0),
1442 { unit: "minute" },
1443 );
1444 ```
1445
1446- **BREAKING**: `parse` that previously used to convert strings and
1447 numbers to dates now parses only strings in an arbitrary format
1448 specified as an argument. Use `toDate` to coerce numbers and `parseISO`
1449 to parse ISO 8601 strings.
1450
1451 ```javascript
1452 // Before v2.0.0
1453 parse("2016-01-01");
1454 parse(1547005581366);
1455 parse(new Date()); // Clone the date
1456
1457 // v2.0.0 onward
1458 parse("2016-01-01", "yyyy-MM-dd", new Date());
1459 parseISO("2016-01-01");
1460 toDate(1547005581366);
1461 toDate(new Date()); // Clone the date
1462 ```
1463
1464- **BREAKING**: `toDate` (previously `parse`) now doesn't accept string
1465 arguments but only numbers and dates. `toDate` called with an invalid
1466 argument will return `Invalid Date`.
1467
1468- **BREAKING**: new locale format.
1469 See [docs/Locale](https://date-fns.org/docs/Locale).
1470 Locales renamed:
1471
1472 - `en` → `en-US`
1473 - `zh_cn` → `zh-CN`
1474 - `zh_tw` → `zh-TW`
1475
1476 ```javascript
1477 // Before v2.0.0
1478 import locale from "date-fns/locale/zh_cn";
1479
1480 // v2.0.0 onward
1481 import locale from "date-fns/locale/zh-CN";
1482 ```
1483
1484- **BREAKING**: now `closestTo` and `closestIndexTo` don't throw an exception
1485 when the second argument is not an array, and return Invalid Date instead.
1486
1487- **BREAKING**: now `isValid` doesn't throw an exception
1488 if the first argument is not an instance of Date.
1489 Instead, argument is converted beforehand using `toDate`.
1490
1491 Examples:
1492
1493 | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
1494 | ------------------------- | ------------- | ------------- |
1495 | `new Date()` | `true` | `true` |
1496 | `new Date('2016-01-01')` | `true` | `true` |
1497 | `new Date('')` | `false` | `false` |
1498 | `new Date(1488370835081)` | `true` | `true` |
1499 | `new Date(NaN)` | `false` | `false` |
1500 | `'2016-01-01'` | `TypeError` | `false` |
1501 | `''` | `TypeError` | `false` |
1502 | `1488370835081` | `TypeError` | `true` |
1503 | `NaN` | `TypeError` | `false` |
1504
1505 We introduce this change to make _date-fns_ consistent with ECMAScript behavior
1506 that try to coerce arguments to the expected type
1507 (which is also the case with other _date-fns_ functions).
1508
1509- **BREAKING**: functions now throw `RangeError` if optional values passed to `options`
1510 are not `undefined` or have expected values.
1511 This change is introduced for consistency with ECMAScript standard library which does the same.
1512
1513- **BREAKING**: `format`, `formatDistance` (previously `distanceInWords`) and
1514 `formatDistanceStrict` (previously `distanceInWordsStrict`) now throw
1515 `RangeError` if one of the passed arguments is invalid. It reflects behavior of
1516 `toISOString` and Intl API. See [#1032](https://github.com/date-fns/date-fns/pull/1032).
1517
1518- **BREAKING**: all functions now implicitly convert arguments by following rules:
1519
1520 | | date | number | string | boolean |
1521 | --------- | ------------ | ------ | ----------- | ------- |
1522 | 0 | new Date(0) | 0 | '0' | false |
1523 | '0' | Invalid Date | 0 | '0' | false |
1524 | 1 | new Date(1) | 1 | '1' | true |
1525 | '1' | Invalid Date | 1 | '1' | true |
1526 | true | Invalid Date | NaN | 'true' | true |
1527 | false | Invalid Date | NaN | 'false' | false |
1528 | null | Invalid Date | NaN | 'null' | false |
1529 | undefined | Invalid Date | NaN | 'undefined' | false |
1530 | NaN | Invalid Date | NaN | 'NaN' | false |
1531
1532 Notes:
1533
1534 - as before, arguments expected to be `Date` are converted to `Date` using _date-fns'_ `toDate` function;
1535 - arguments expected to be numbers are converted to integer numbers using our custom `toInteger` implementation
1536 (see [#765](https://github.com/date-fns/date-fns/pull/765));
1537 - arguments expected to be strings are converted to strings using JavaScript's `String` function;
1538 - arguments expected to be booleans are converted to boolean using JavaScript's `Boolean` function.
1539
1540 `null` and `undefined` passed to optional arguments (i.e. properties of `options` argument)
1541 are ignored as if no argument was passed.
1542
1543 If any resulting argument is invalid (i.e. `NaN` for numbers and `Invalid Date` for dates),
1544 an invalid value will be returned:
1545
1546 - `false` for functions that return booleans (expect `isValid`);
1547 - `Invalid Date` for functions that return dates;
1548 - and `NaN` for functions that return numbers.
1549
1550 See tests and PRs [#460](https://github.com/date-fns/date-fns/pull/460) and
1551 [#765](https://github.com/date-fns/date-fns/pull/765) for exact behavior.
1552
1553- **BREAKING**: all functions now check if the passed number of arguments is less
1554 than the number of required arguments and will throw `TypeError` exception if so.
1555
1556- **BREAKING**: all functions that accept numbers as arguments, now coerce
1557 values using `Number()` and also round off decimals. Positive decimals are
1558 rounded using `Math.floor`, decimals less than zero are rounded using
1559 `Math.ceil`.
1560
1561- **BREAKING**: The Bower & UMD/CDN package versions are no longer supported.
1562
1563- **BREAKING**: `null` now is not a valid date. `isValid(null)` returns `false`;
1564 `toDate(null)` returns an invalid date. Since `toDate` is used internally
1565 by all the functions, operations over `null` will also return an invalid date.
1566 [See #537](https://github.com/date-fns/date-fns/issues/537) for the reasoning.
1567
1568- `toDate` (previously `parse`) and `isValid` functions now accept `any` type
1569 as the first argument.
1570
1571- [Exclude `docs.json` from the npm package](https://github.com/date-fns/date-fns/pull/837). Kudos to [@hawkrives](https://github.com/hawkrives).
1572
1573### Added
1574
1575- FP functions like those in [lodash](https://github.com/lodash/lodash/wiki/FP-Guide),
1576 that support [currying](https://en.wikipedia.org/wiki/Currying), and, as a consequence,
1577 functional-style [function composing](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba).
1578
1579 Functions with options (`format`, `parse`, etc.) have two FP counterparts:
1580 one that has the options object as its first argument and one that hasn't.
1581 The name of the former has `WithOptions` added to the end of its name.
1582
1583 In FP functions, the order of arguments is reversed.
1584
1585 See [FP Guide](https://date-fns.org/docs/FP-Guide) for more information.
1586
1587 ```javascript
1588 import addYears from "date-fns/fp/addYears";
1589 import formatWithOptions from "date-fns/fp/formatWithOptions";
1590 import eo from "date-fns/locale/eo";
1591
1592 // If FP function has not received enough arguments, it returns another function
1593 const addFiveYears = addYears(5);
1594
1595 // Several arguments can be curried at once
1596 const dateToString = formatWithOptions({ locale: eo }, "d MMMM yyyy");
1597
1598 const dates = [
1599 new Date(2017, 0 /* Jan */, 1),
1600 new Date(2017, 1 /* Feb */, 11),
1601 new Date(2017, 6 /* Jul */, 2),
1602 ];
1603
1604 const formattedDates = dates.map((date) => dateToString(addFiveYears(date)));
1605 //=> ['1 januaro 2022', '11 februaro 2022', '2 julio 2022']
1606 ```
1607
1608- Added support for [ECMAScript Modules](http://www.ecma-international.org/ecma-262/6.0/#sec-modules).
1609
1610 It allows usage with bundlers that support tree-shaking,
1611 like [rollup.js](http://rollupjs.org) and [webpack](https://webpack.js.org):
1612
1613 ```javascript
1614 // Without tree-shaking:
1615 import format from "date-fns/format";
1616 import parse from "date-fns/parse";
1617
1618 // With tree-shaking:
1619 import { format, parse } from "date-fns";
1620 ```
1621
1622 Also, ESM functions provide default export, they can be used with TypeScript
1623 to import functions in more idiomatic way:
1624
1625 ```typescript
1626 // Before
1627 import * as format from "date-fns/format";
1628
1629 // Now
1630 import format from "date-fns/format";
1631 ```
1632
1633- `formatRelative` function. See [formatRelative](https://date-fns.org/docs/formatRelative)
1634
1635- Flow typings for `index.js`, `fp/index.js`, `locale/index.js`, and their ESM equivalents.
1636 See PR [#558](https://github.com/date-fns/date-fns/pull/558)
1637
1638- New locale-dependent week-numbering year helpers:
1639
1640 - `getWeek`
1641
1642 - `getWeekYear`
1643
1644 - `setWeek`
1645
1646 - `setWeekYear`
1647
1648 - `startOfWeekYear`
1649
1650- Added `eachWeekOfInterval`, the weekly equivalent of `eachDayOfInterval`
1651
1652- [Added `getUnixTime` function](https://github.com/date-fns/date-fns/pull/870). Kudos to [@Kingwl](https://github.com/Kingwl).
1653
1654- [New decade helpers](https://github.com/date-fns/date-fns/pull/839). Thanks to [@y-nk](https://github.com/y-nk)!
1655
1656 - `getDecade`
1657
1658 - `startOfDecade`
1659
1660 - `endOfDecade`
1661
1662 - `lastDayOfDecade`
1663
1664- [New `roundToNearestMinutes` function](https://github.com/date-fns/date-fns/pull/928). Kudos to [@xkizer](https://github.com/xkizer).
1665
1666- Added new function `fromUnixTime`. Thanks to [@xkizer](https://github.com/xkizer).
1667
1668- 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](https://github.com/laekettavong)!
1669
1670 - `eachWeekendOfInterval`
1671
1672 - `eachWeekendOfMonth`
1673
1674 - `eachWeekendOfYear`
1675
1676- Build-efficient `lightFormat` that only supports the popular subset of tokens. See [#1050](https://github.com/date-fns/date-fns/pull/1015).
1677
1678- `parseISO` function that parses ISO 8601 strings. See [#1023](https://github.com/date-fns/date-fns/pull/1023).
1679
1680- Add constants that can be imported directly from `date-fns` or the submodule `date-fns/constants`:
1681
1682 - `maxTime`
1683
1684 - `minTime`
1685
1686- New locales:
1687
1688 - [Norwegian Nynorsk locale (nn)](https://github.com/date-fns/date-fns/pull/1172)
1689 by [@draperunner](https://github.com/draperunner).
1690
1691 - [Ukrainian locale (ua)](https://github.com/date-fns/date-fns/pull/532)
1692 by [@korzhyk](https://github.com/korzhyk).
1693
1694 - [Vietnamese locale (vi)](https://github.com/date-fns/date-fns/pull/546)
1695 by [@trongthanh](https://github.com/trongthanh).
1696
1697 - [Persian locale (fa-IR)](https://github.com/date-fns/date-fns/pull/1113)
1698 by [@mort3za](https://github.com/mort3za).
1699
1700 - [Latvian locale (lv)](https://github.com/date-fns/date-fns/pull/1175)
1701 by [@prudolfs](https://github.com/prudolfs).
1702
1703 - [Bengali locale (bb)](https://github.com/date-fns/date-fns/pull/845)
1704 by [@nutboltu](https://github.com/nutboltu) and [@touhidrahman](https://github.com/touhidrahman).
1705
1706 - [Hungarian (hu) and Lithuanian (lt) locales](https://github.com/date-fns/date-fns/pull/864)
1707 by [@izifortune](https://github.com/izifortune) and [pardoeryanair](https://github.com/pardoeryanair).
1708
1709 - [Canadian English locale (en-CA)](https://github.com/date-fns/date-fns/pull/688)
1710 by [@markowsiak](https://github.com/markowsiak).
1711
1712 - [Great Britain English locale (en-GB)](https://github.com/date-fns/date-fns/pull/563)
1713 by [@glintik](https://github.com/glintik).
1714
1715 - [Uighur locale (ug)](https://github.com/date-fns/date-fns/pull/1080)
1716 by [@abduwaly](https://github.com/abduwaly).
1717
1718- [Added new function `differenceInBusinessDays`](https://github.com/date-fns/date-fns/pull/1194)
1719 which calculates the difference in business days. Kudos to [@ThorrStevens](https://github.com/ThorrStevens)!
1720
1721- [Added new function `addBusinessDays`](https://github.com/date-fns/date-fns/pull/1154),
1722 similar to `addDays` but ignoring weekends. Thanks to [@ThorrStevens](https://github.com/ThorrStevens)!
1723
1724## [1.30.1] - 2018-12-10
1725
1726### Fixed
1727
1728- [Fixed DST issue](https://github.com/date-fns/date-fns/pull/1005). See [#972](https://github.com/date-fns/date-fns/issues/972) and [#992](https://github.com/date-fns/date-fns/issues/992) for more details. This fix was backported from v2.
1729
1730- Fix a few bugs that appear in timezones with offsets that include seconds (e.g. GMT+00:57:44). See PR [#789](https://github.com/date-fns/date-fns/issues/789). This fix was backported from v2.
1731
1732- [Fixed misspelled January in the Thai locale](https://github.com/date-fns/date-fns/pull/913). Thanks to [@ratchapol-an](https://github.com/ratchapol-an)!
1733
1734### Added
1735
1736- [Added Serbian locale](https://github.com/date-fns/date-fns/pull/717). Kudos to [@mawi12345](https://github.com/mawi12345)!
1737
1738- [Added Belarusian locale](https://github.com/date-fns/date-fns/pull/716). Kudos to [@mawi12345](https://github.com/mawi12345) again!
1739
1740### Changed
1741
1742- [Improved ja translation of distanceInWords](https://github.com/date-fns/date-fns/pull/880). Thanks to [@kudohamu](https://github.com/kudohamu)!
1743
1744## [1.30.0] - 2018-12-10
1745
1746⚠️ The release got failed.
1747
1748## [1.29.0] - 2017-10-11
1749
1750### Fixed
1751
1752- Fixed Italian translations for `formatDistance`. ([see the issue: #550](https://github.com/date-fns/date-fns/issues/550); [see the PR: #552](https://github.com/date-fns/date-fns/pull/552))
1753 Thanks to [@giofilo](https://github.com/giofilo)!
1754
1755### Added
1756
1757- [Hungarian locale (hu)](https://github.com/date-fns/date-fns/pull/503)
1758 (thanks to László Horváth [@horvathlg](https://github.com/horvathlg))
1759
1760- [Slovenian locale (sl)](https://github.com/date-fns/date-fns/pull/505)
1761 (thanks to Adam Stradovnik [@Neoglyph](https://github.com/Neoglyph))
1762
1763- Added `step` to `eachDay` function. Thanks to [@BDav24](https://github.com/BDav24).
1764 See PR [#487](https://github.com/date-fns/date-fns/pull/487).
1765
1766## [1.28.5] - 2017-05-19
1767
1768### Fixed
1769
1770- Fixed a.m./p.m. formatters in Chinese Simplified locale.
1771 Thanks to [@fnlctrl](https://github.com/fnlctrl).
1772 See PR [#486](https://github.com/date-fns/date-fns/pull/486)
1773
1774## [1.28.4] - 2017-04-26
1775
1776### Fixed
1777
1778- Fixed accents on weekdays in the Italian locale.
1779 See PR [#481](https://github.com/date-fns/date-fns/pull/481).
1780 Thanks to [@albertorestifo](https://github.com/albertorestifo)
1781
1782- Fixed typo in `ddd` format token in Spanish language locale.
1783 Kudos to [@fjaguero](https://github.com/fjaguero).
1784 See PR [#482](https://github.com/date-fns/date-fns/pull/482)
1785
1786## [1.28.3] - 2017-04-14
1787
1788### Fixed
1789
1790- Fixed ordinal numbers for Danish language locale. Thanks to [@kgram](https://github.com/kgram).
1791 See PR [#474](https://github.com/date-fns/date-fns/pull/474)
1792
1793## [1.28.2] - 2017-03-27
1794
1795### Fixed
1796
1797- Fixed `dd` and `ddd` formatters in Polish language locale. Kudos to [@justrag](https://github.com/justrag).
1798 See PR: [#467](https://github.com/date-fns/date-fns/pull/467)
1799
1800## [1.28.1] - 2017-03-19
1801
1802### Fixed
1803
1804- Fixed DST border bug in `addMilliseconds`, `addSeconds`, `addMinutes`, `addHours`,
1805 `subMilliseconds`, `subSeconds`, `subMinutes` and `subHours`.
1806 See issue [#465](https://github.com/date-fns/date-fns/issues/465)
1807
1808- Minor fix for Indonesian locale. Thanks to [@bentinata](https://github.com/bentinata).
1809 See PR: [#458](https://github.com/date-fns/date-fns/pull/458)
1810
1811## [1.28.0] - 2017-02-27
1812
1813### Added
1814
1815- [Romanian locale (ro)](https://github.com/date-fns/date-fns/pull/446)
1816 (thanks to Sergiu Munteanu [@jsergiu](https://github.com/jsergiu))
1817
1818### Fixed
1819
1820- All functions now convert all their arguments to the respective types.
1821 See PR: [#443](https://github.com/date-fns/date-fns/pull/443)
1822
1823- Fixes for ordinals (1er, 2, 3, …) in French locale.
1824 Thanks to [@fbonzon](https://github.com/fbonzon).
1825 See PR: [#449](https://github.com/date-fns/date-fns/pull/449)
1826
1827## [1.27.2] - 2017-02-01
1828
1829### Fixed
1830
1831- Various fixes for Dutch locale. See PR: [#416](https://github.com/date-fns/date-fns/pull/416).
1832 Thanks to Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)
1833
1834## [1.27.1] - 2017-01-20
1835
1836### Fixed
1837
1838- Added generation of TypeScript locale sub-modules, allowing import of locales in TypeScript.
1839
1840## [1.27.0] - 2017-01-19
1841
1842### Added
1843
1844- [Macedonian locale (mk)](https://github.com/date-fns/date-fns/pull/398)
1845 (thanks to Petar Vlahu [@vlahupetar](https://github.com/vlahupetar))
1846
1847## [1.26.0] - 2017-01-15
1848
1849### Added
1850
1851- `getTime`
1852
1853### Fixed
1854
1855- Various fixes for Japanese locale. See PR: [395](https://github.com/date-fns/date-fns/pull/395).
1856 Thanks to Yamagishi Kazutoshi [@ykzts](https://github.com/ykzts)
1857
1858## [1.25.0] - 2017-01-11
1859
1860### Added
1861
1862- [Bulgarian locale (bg)](https://github.com/date-fns/date-fns/pull/357)
1863 (thanks to Nikolay Stoynov [@arvigeus](https://github.com/arvigeus))
1864
1865- [Czech locale (cs)](https://github.com/date-fns/date-fns/pull/386)
1866 (thanks to David Rus [@davidrus](https://github.com/davidrus))
1867
1868## [1.24.0] - 2017-01-06
1869
1870### Added
1871
1872- [Modern Standard Arabic locale (ar)](https://github.com/date-fns/date-fns/pull/367)
1873 (thanks to Abdallah Hassan [@AbdallahAHO](https://github.com/AbdallahAHO))
1874
1875## [1.23.0] - 2017-01-05
1876
1877### Added
1878
1879- Auto generate TypeScript and flow typings from documentation on release.
1880 Thanks to [@mattlewis92](https://github.com/mattlewis92).
1881 See related PRs: [#355](https://github.com/date-fns/date-fns/pull/355),
1882 [#370](https://github.com/date-fns/date-fns/pull/370)
1883
1884- [Croatian locale (hr)](https://github.com/date-fns/date-fns/pull/365)
1885 (thanks to Matija Marohnić [@silvenon](https://github.com/silvenon))
1886
1887- [Thai locale (th)](https://github.com/date-fns/date-fns/pull/362)
1888 (thanks to Athiwat Hirunworawongkun [@athivvat](https://github.com/athivvat))
1889
1890- [Finnish locale (fi)](https://github.com/date-fns/date-fns/pull/361)
1891 (thanks to Pyry-Samuli Lahti [@Pyppe](https://github.com/Pyppe))
1892
1893## [1.22.0] - 2016-12-28
1894
1895### Added
1896
1897- [Icelandic locale (is)](https://github.com/date-fns/date-fns/pull/356)
1898 (thanks to Derek Blank [@derekblank](https://github.com/derekblank))
1899
1900## [1.21.1] - 2016-12-18
1901
1902### Fixed
1903
1904- Fixed `isBefore` and `isAfter` documentation mistakes.
1905
1906## [1.21.0] - 2016-12-16
1907
1908### Added
1909
1910- [Filipino locale (fil)](https://github.com/date-fns/date-fns/pull/339)
1911 (thanks to Ian De La Cruz [@RIanDeLaCruz](https://github.com/RIanDeLaCruz))
1912
1913- [Danish locale (da)](https://github.com/date-fns/date-fns/pull/343)
1914 (kudos to Anders B. Hansen [@Andersbiha](https://github.com/Andersbiha))
1915
1916## [1.20.1] - 2016-12-14
1917
1918### Fixed
1919
1920- Fixed documentation for `getOverlappingDaysInRanges`.
1921
1922## [1.20.0] - 2016-12-13
1923
1924### Added
1925
1926- `areRangesOverlapping` and `getOverlappingDaysInRanges`
1927 Thanks to Joanna T [@asia-t](https://github.com/asia-t).
1928 See PR: [#331](https://github.com/date-fns/date-fns/pull/331)
1929
1930## [1.19.0] - 2016-12-13
1931
1932### Added
1933
1934- [Greek locale (el)](https://github.com/date-fns/date-fns/pull/334)
1935 (kudos to Theodoros Orfanidis [@teoulas](https://github.com/teoulas))
1936
1937- [Slovak locale (sk)](https://github.com/date-fns/date-fns/pull/336)
1938 (kudos to Marek Suscak [@mareksuscak](https://github.com/mareksuscak))
1939
1940- Added yarn support.
1941 Thanks to Uladzimir Havenchyk [@havenchyk](https://github.com/havenchyk).
1942 See PR: [#288](https://github.com/date-fns/date-fns/pull/288)
1943
1944## [1.18.0] - 2016-12-12
1945
1946### Added
1947
1948- [Turkish locale (tr)](https://github.com/date-fns/date-fns/pull/329)
1949 (kudos to Alpcan Aydın [@alpcanaydin](https://github.com/alpcanaydin))
1950
1951- [Korean locale (ko)](https://github.com/date-fns/date-fns/pull/327)
1952 (thanks to Hong Chulju [@angdev](https://github.com/angdev))
1953
1954### Fixed
1955
1956- `SS` and `SSS` formats in `format` are now correctly displayed with leading zeros.
1957 Thanks to Paul Dijou [@pauldijou](https://github.com/pauldijou).
1958 See PR: [#330](https://github.com/date-fns/date-fns/pull/330)
1959
1960## [1.17.0] - 2016-12-10
1961
1962### Added
1963
1964- [Polish locale (pl)](https://github.com/date-fns/date-fns/pull/294)
1965 (thanks to Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks))
1966
1967- [Portuguese locale (pt)](https://github.com/date-fns/date-fns/pull/316)
1968 (thanks to Dário Freire [@dfreire](https://github.com/dfreire))
1969
1970- [Swedish locale (sv)](https://github.com/date-fns/date-fns/pull/311)
1971 (thanks to Johannes Ulén [@ejulen](https://github.com/ejulen))
1972
1973- [French locale (fr)](https://github.com/date-fns/date-fns/pull/281)
1974 (thanks to Jean Dupouy [@izeau](https://github.com/izeau))
1975
1976- Performance tests. See PR: [#289](https://github.com/date-fns/date-fns/pull/289)
1977
1978### Fixed
1979
1980- Fixed TypeScript and flow typings for `isValid`.
1981 See PR: [#310](https://github.com/date-fns/date-fns/pull/310)
1982
1983- Fixed incorrect locale tests that could potentially lead to `format` bugs.
1984 Kudos to Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks).
1985 See related PRs: [#312](https://github.com/date-fns/date-fns/pull/312),
1986 [#320](https://github.com/date-fns/date-fns/pull/320)
1987
1988- Minor language fixes in the documentation.
1989 Thanks to Vedad Šoše [@vedadsose](https://github.com/vedadsose) ([#314](https://github.com/date-fns/date-fns/pull/314))
1990 and Asia [@asia-t](https://github.com/asia-t) ([#318](https://github.com/date-fns/date-fns/pull/318))
1991
1992### Changed
1993
1994- `format` now returns `String('Invalid Date')` if the passed date is invalid.
1995 See PR: [#323](https://github.com/date-fns/date-fns/pull/323)
1996
1997- `distanceInWords`, `distanceInWordsToNow`, `distanceInWordsStrict` and `format` functions now
1998 check if the passed locale is valid, and fallback to English locale otherwise.
1999 See PR: [#321](https://github.com/date-fns/date-fns/pull/321)
2000
2001- _Internal_: use a loop instead of `Object.keys` in `buildFormattingTokensRegExp`
2002 to improve compatibility with older browsers.
2003 See PR: [#322](https://github.com/date-fns/date-fns/pull/322)
2004
2005## [1.16.0] - 2016-12-08
2006
2007### Added
2008
2009- [Italian locale (it)](https://github.com/date-fns/date-fns/pull/298)
2010 (thanks to Alberto Restifo [@albertorestifo](https://github.com/albertorestifo))
2011
2012- For German `buildDistanceInWordsLocale`, add nominative case translations (for distances without a suffix).
2013 Kudos to Asia [@asia-t](https://github.com/asia-t).
2014 See related PR: [#295](https://github.com/date-fns/date-fns/pull/295)
2015
2016## [1.15.1] - 2016-12-07
2017
2018### Fixed
2019
2020- Fixed TypeScript imports from individual modules.
2021 Thanks to [@mattlewis92](https://github.com/mattlewis92).
2022 See related PR: [#287](https://github.com/date-fns/date-fns/pull/287)
2023
2024## [1.15.0] - 2016-12-07
2025
2026### Added
2027
2028- [Indonesian locale (id)](https://github.com/date-fns/date-fns/pull/299)
2029 (thanks to Rahmat Budiharso [@rbudiharso](https://github.com/rbudiharso))
2030
2031- [Catalan locale (ca)](https://github.com/date-fns/date-fns/pull/300)
2032 (thanks to Guillermo Grau [@guigrpa](https://github.com/guigrpa))
2033
2034### Fixed
2035
2036- Fixed some inaccuracies in Spanish locale.
2037 Kudos to [@guigrpa](https://github.com/guigrpa).
2038 See related PR: [#302](https://github.com/date-fns/date-fns/pull/302)
2039
2040## [1.14.1] - 2016-12-06
2041
2042### Fixed
2043
2044- Fixed broken test for Norwegian Bokmål locale.
2045
2046## [1.14.0] - 2016-12-06
2047
2048### Added
2049
2050- [Norwegian Bokmål locale (nb)](https://github.com/date-fns/date-fns/pull/291)
2051 (thanks to Hans-Kristian Koren [@Hanse](https://github.com/Hanse))
2052
2053## [1.13.0] - 2016-12-06
2054
2055### Added
2056
2057- [Chinese Traditional locale (zh_tw)](https://github.com/date-fns/date-fns/pull/283)
2058 (thanks to tonypai [@tpai](https://github.com/tpai)).
2059
2060- [Dutch language locale (nl)](https://github.com/date-fns/date-fns/pull/278)
2061 (kudos to Jorik Tangelder [@jtangelder](https://github.com/jtangelder))
2062
2063## [1.12.1] - 2016-12-05
2064
2065### Fixed
2066
2067- Added `distanceInWordsStrict` to the list of supported functions in I18n doc.
2068
2069## [1.12.0] - 2016-12-05
2070
2071### Added
2072
2073- [Spanish language locale (es)](https://github.com/date-fns/date-fns/pull/269)
2074 (thanks to Juan Angosto [@juanangosto](https://github.com/juanangosto)).
2075
2076### Fixed
2077
2078- Fixed flow typings for some of the functions.
2079 See PR: [#273](https://github.com/date-fns/date-fns/pull/273)
2080
2081## [1.11.2] - 2016-11-28
2082
2083### Fixed
2084
2085- Bug in `parse` when it sometimes parses ISO week-numbering dates incorrectly.
2086 See PR: [#262](https://github.com/date-fns/date-fns/pull/262)
2087
2088- Bug in some functions which caused them to handle dates earlier than 100 AD incorrectly.
2089 See PR: [#263](https://github.com/date-fns/date-fns/pull/263)
2090
2091## [1.11.1] - 2016-11-24
2092
2093### Fixed
2094
2095- Include TypeScript typings with npm package.
2096
2097## [1.11.0] - 2016-11-23
2098
2099### Added
2100
2101- `distanceInWordsStrict`.
2102 Kudos to [@STRML](https://github.com/STRML).
2103 See related PR: [#254](https://github.com/date-fns/date-fns/pull/254)
2104
2105- [TypeScript](https://www.typescriptlang.org/) typings for all functions.
2106 Kudos to [@mattlewis92](https://github.com/mattlewis92).
2107 See related PR: [#255](https://github.com/date-fns/date-fns/pull/255)
2108
2109## [1.10.0] - 2016-11-01
2110
2111### Added
2112
2113- `parse` now can parse dates that are ISO 8601 centuries (e.g., `19` and `+0019`).
2114
2115 ```javascript
2116 var result = parse("19");
2117 //=> Mon Jan 01 1900 00:00:00
2118 ```
2119
2120- In `parse`, added ability to specify the number of additional digits
2121 for extended year or century format (possible values are 0, 1 or 2; default is 2).
2122
2123 ```javascript
2124 parse("+002016-11-01");
2125 parse("+02016-11-01", { additionalDigits: 1 });
2126 parse("+2016-11-01", { additionalDigits: 0 });
2127 ```
2128
2129## [1.9.0] - 2016-10-25
2130
2131### Added
2132
2133- Got index.js imports to work with SystemJS.
2134
2135## [1.8.1] - 2016-10-24
2136
2137### Fixed
2138
2139- Added Japanese and German language locales to the list in I18n doc.
2140
2141## [1.8.0] - 2016-10-23
2142
2143### Added
2144
2145- [Japanese language locale (ja)](https://github.com/date-fns/date-fns/pull/241)
2146 (thanks to Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu) again!)
2147
2148- `getISODay`
2149
2150- `setISODay`
2151
2152## [1.7.0] - 2016-10-20
2153
2154### Added
2155
2156- [German language locale (de)](https://github.com/date-fns/date-fns/pull/237)
2157 (thanks to Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)).
2158
2159## [1.6.0] - 2016-10-16
2160
2161### Added
2162
2163- [Chinese Simplified locale (zh_cn)](https://github.com/date-fns/date-fns/pull/235)
2164 (kudos to Changyu [@KingMario](https://github.com/KingMario) Geng).
2165
2166## [1.5.2] - 2016-10-13
2167
2168### Fixed
2169
2170- Incorrectly generated docs for `format`.
2171
2172- Fixed typo in I18n doc.
2173
2174## [1.5.1] - 2016-10-12
2175
2176### Fixed
2177
2178- A change log entry for [1.5.0] is added.
2179
2180## [1.5.0] - 2016-10-12
2181
2182### Added
2183
2184- [The initial I18n support](https://date-fns.org/docs/I18n)
2185
2186## [1.4.0] - 2016-10-09
2187
2188### Added
2189
2190- Basic [SystemJS](https://github.com/systemjs/systemjs) support.
2191
2192### Fixed
2193
2194- Fixed incorrect behaviour of `YYYY` and `YY` for years prior to 1000:
2195 now `format(new Date('0001-01-01'), 'YYYY-MM-DD')` returns `0001-01-01`
2196 instead of `1-01-01`.
2197
2198## [1.3.0] - 2016-05-26
2199
2200### Added
2201
2202- `closestIndexTo`
2203
2204## [1.2.0] - 2016-05-23
2205
2206### Added
2207
2208- Added an ability to pass negative numbers to `setDay`.
2209
2210## [1.1.1] - 2016-05-19
2211
2212### Fixed
2213
2214- Fixed [Flow](http://flowtype.org/) declarations for some of the functions.
2215
2216## [1.1.0] - 2016-05-19
2217
2218### Added
2219
2220- [Flow](http://flowtype.org/) declarations for each function
2221 in [the ".js.flow" style](http://flowtype.org/docs/declarations.html#declaration-files).
2222 Kudos to [@JohnyDays](https://github.com/JohnyDays). See related PRs:
2223
2224 - [#205](https://github.com/date-fns/date-fns/pull/205)
2225
2226 - [#207](https://github.com/date-fns/date-fns/pull/207)
2227
2228## [1.0.0] - 2016-05-18
2229
2230### Fixed
2231
2232- `format` now returns the correct result for key `E`.
2233
2234- Prevent `startOf...`, `endOf...` and `lastDayOf...` functions
2235 to return dates with an incorrect time when the date is modifying
2236 into another time zone.
2237
2238- `parse` now parses years from 1 AD to 99 AD correctly.
2239
2240- Fix a bug in `getISOWeek` appearing because of a changing time zone
2241 (e.g., when the given date is in DST and the start of the ISO year is not).
2242
2243### Changed
2244
2245- **BREAKING**: all functions are moved to the root of the library, so they
2246 are now accessible with `require('date-fns/name_of_function')` or
2247 `import nameOfFunction from 'date-fns/name_of_function'`.
2248
2249 ```javascript
2250 // Before v1.0.0
2251 var addMonths = require("date-fns/src/add_months");
2252
2253 // v1.0.0 onward
2254 var addMonths = require("date-fns/add_months");
2255 ```
2256
2257- **BREAKING**: functions that had the last optional argument `weekStartsAt`
2258 (i.e. `endOfWeek`, `isSameWeek`, `lastDayOfWeek`, `setDay`, `startOfWeek`)
2259 now instead receive the object `options` with the property `options.weekStartsOn`
2260 as the last argument.
2261
2262 ```javascript
2263 // Before v1.0.0
2264 var result = endOfWeek(new Date(2014, 8, 2), 1);
2265
2266 // v1.0.0 onward
2267 var result = endOfWeek(new Date(2014, 8, 2), { weekStartsOn: 1 });
2268 ```
2269
2270- **BREAKING**: remove the function `getTimeSinceMidnight` that was used inside
2271 the other functions.
2272
2273- **BREAKING**: `differenceInDays` now returns the number of full days instead
2274 of calendar days.
2275
2276- **BREAKING**: `eachDay` and `isWithinRange` now throw an exception
2277 when the given range boundaries are invalid.
2278
2279- Faster `isLeapYear`.
2280
2281- _Internal_: make the documentation more verbose.
2282
2283- _Internal_: convert the tests from Chai to power-assert allowing them
2284 to run against IE8.
2285
2286### Added
2287
2288- `addISOYears`
2289
2290- `closestTo`
2291
2292- `differenceInCalendarDays`
2293
2294- `differenceInCalendarISOWeeks`
2295
2296- `differenceInCalendarISOYears`
2297
2298- `differenceInCalendarMonths`
2299
2300- `differenceInCalendarQuarters`
2301
2302- `differenceInCalendarWeeks`
2303
2304- `differenceInCalendarYears`
2305
2306- `differenceInHours`
2307
2308- `differenceInISOYears`
2309
2310- `differenceInMilliseconds`
2311
2312- `differenceInMinutes`
2313
2314- `differenceInMonths`
2315
2316- `differenceInQuarters`
2317
2318- `differenceInSeconds`
2319
2320- `differenceInWeeks`
2321
2322- `differenceInYears`
2323
2324- `distanceInWords`
2325
2326- `distanceInWordsToNow`
2327
2328- `endOfISOWeek`
2329
2330- `endOfISOYear`
2331
2332- `endOfToday`
2333
2334- `endOfTomorrow`
2335
2336- `endOfYesterday`
2337
2338- `getDaysInYear`
2339
2340- `isDate`
2341
2342- `isFriday`
2343
2344- `isMonday`
2345
2346- `isSameISOWeek`
2347
2348- `isSameISOYear`
2349
2350- `isSaturday`
2351
2352- `isSunday`
2353
2354- `isThisHour`
2355
2356- `isThisISOWeek`
2357
2358- `isThisISOYear`
2359
2360- `isThisMinute`
2361
2362- `isThisMonth`
2363
2364- `isThisQuarter`
2365
2366- `isThisSecond`
2367
2368- `isThisWeek`
2369
2370- `isThisYear`
2371
2372- `isThursday`
2373
2374- `isTomorrow`
2375
2376- `isTuesday`
2377
2378- `isValid`
2379
2380- `isWednesday`
2381
2382- `isYesterday`
2383
2384- `lastDayOfISOWeek`
2385
2386- `lastDayOfISOYear`
2387
2388- `startOfISOWeek`
2389
2390- `startOfToday`
2391
2392- `startOfTomorrow`
2393
2394- `startOfYesterday`
2395
2396- `subISOYears`
2397
2398- Add `Qo`, `W`, `Wo`, `WW`, `GG`, `GGGG`, `Z`, `ZZ`, `X`, `x` keys to `format`.
2399
2400## [0.17.0] - 2015-09-29
2401
2402### Fixed
2403
2404- Fixed a lot of bugs appearing when date is modifying into other time zone
2405 (e.g., when adding months and original date is in DST but new date is not).
2406
2407- Prevent instances of Date to lose milliseconds value when passed to.
2408 `parse` in IE10.
2409
2410### Changed
2411
2412- `setISOWeek` now keeps time from original date.
2413
2414- _Internal_: reuse `getDaysInMonth` inside of `addMonths`.
2415
2416### Added
2417
2418- `differenceInDays`
2419
2420- `getTimeSinceMidnight`
2421
2422- `format` now has new format key `aa`, which returns `a.m.`/`p.m.`
2423 as opposed to `a` that returns `am`/`pm`.
2424
2425- Complete UMD package (for Bower and CDN).
2426
2427## [0.16.0] - 2015-09-01
2428
2429### Changed
2430
2431- Use `parse` to clean date arguments in all functions.
2432
2433- `parse` now fallbacks to `new Date` when the argument
2434 is not an ISO formatted date.
2435
2436- _Internal_: reuse `getDaysInMonth` inside of `setMonth`.
2437
2438### Added
2439
2440- `addQuarters`
2441
2442- `addWeeks`
2443
2444- `endOfQuarter`
2445
2446- `getDate`
2447
2448- `getDay`
2449
2450- `getDaysInMonth`
2451
2452- `getHours`
2453
2454- `getISOWeeksInYear`
2455
2456- `getMilliseconds`
2457
2458- `getMinutes`
2459
2460- `getMonth`
2461
2462- `getSeconds`
2463
2464- `getYear`
2465
2466- `isLeapYear`
2467
2468- `isSameHour`
2469
2470- `isSameMinute`
2471
2472- `isSameQuarter`
2473
2474- `isSameSecond`
2475
2476- `lastDayOfQuarter`
2477
2478- `lastDayOfWeek`
2479
2480- `max`
2481
2482- `min`
2483
2484- `setDate`
2485
2486- `setDay`
2487
2488- `setHours`
2489
2490- `setMilliseconds`
2491
2492- `setMinutes`
2493
2494- `setSeconds`
2495
2496- `startOfQuarter`
2497
2498- `subQuarters`
2499
2500- `subWeeks`
2501
2502## [0.15.0] - 2015-08-26
2503
2504### Changed
2505
2506- `format` now returns `a.m.`/`p.m.` instead of `am`/`pm`.
2507
2508- `setMonth` now sets last day of month if original date was last day
2509 of longer month.
2510
2511- _Internal_: Fix code style according to ESLint.
2512
2513- _Internal_: Make tests run through all time zones.
2514
2515### Added
2516
2517- `getQuarter`
2518
2519- `setQuarter`
2520
2521- `getDayOfYear`
2522
2523- `setDayOfYear`
2524
2525- `isPast`
2526
2527- `addSeconds`
2528
2529- `subSeconds`
2530
2531- `startOfSecond`
2532
2533- `endOfSecond`
2534
2535- `startOfMinute`
2536
2537- `endOfMinute`
2538
2539- `addMilliseconds`
2540
2541- `subMilliseconds`
2542
2543- `endOfYear`
2544
2545- `addYears`
2546
2547- `subYears`
2548
2549- `lastDayOfYear`
2550
2551- `lastDayOfMonth`
2552
2553## [0.14.11] - 2015-08-21
2554
2555### Fixed
2556
2557- `format` now uses `parse` to avoid time zone bugs.
2558
2559### Changed
2560
2561- `setIsoWeek` now sets time to the start of the day.
2562
2563## [0.14.10] - 2015-07-29
2564
2565### Fixed
2566
2567- `format` now behaves correctly with 12:00 am.
2568
2569- `format` now behaves correctly with ordinal numbers.
2570
2571### Added
2572
2573- `compareAsc`
2574
2575- `compareDesc`
2576
2577- `addHours`
2578
2579- `subHours`
2580
2581- `isSameDay`
2582
2583- `parse`
2584
2585- `getISOYear`
2586
2587- `setISOYear`
2588
2589- `startOfISOYear`
2590
2591- `getISOWeek`
2592
2593- `setISOWeek`
2594
2595## [0.14.9] - 2015-01-14
2596
2597### Fixed
2598
2599- `addMonths` now correctly behaves with February
2600 (see [#18](https://github.com/js-fns/date-fns/pull/18)).
2601
2602## [0.14.8] - 2014-12-25
2603
2604### Fixed
2605
2606- `format` function now behaves correctly with `pm`/`am`.
2607
2608## [0.14.6] - 2014-12-04
2609
2610### Fixed
2611
2612- Fix broken Bower support.
2613
2614## [0.14.0] - 2014-11-05
2615
2616### Added
2617
2618- Bower package.
2619
2620## [0.13.0] - 2014-10-22
2621
2622### Added
2623
2624- `addMinutes`
2625
2626- `subMinutes`
2627
2628- `isEqual`
2629
2630- `isBefore`
2631
2632- `isAfter`
2633
2634## [0.12.1] - 2014-10-19
2635
2636### Fixed
2637
2638- Incorrect rounding in `DDD` formatter.
2639
2640## [0.12.0] - 2014-10-15
2641
2642### Added
2643
2644- `isSameYear`
2645
2646## [0.11.0] - 2014-10-15
2647
2648### Added
2649
2650- `isWithinRange`
2651
2652## [0.10.0] - 2014-10-13
2653
2654### Added
2655
2656- `format`
2657
2658- `startOfYear`
2659
2660## [0.9.0] - 2014-10-10
2661
2662### Changed
2663
2664- _Internal_: simplify `isWeekend`
2665
2666### Added
2667
2668- `isFuture`
2669
2670## [0.8.0] - 2014-10-09
2671
2672### Changed
2673
2674- _Internal_: reuse `addDays` inside of `subDays`.
2675
2676### Added
2677
2678- `addMonths`
2679
2680- `subMonths`
2681
2682- `setMonth`
2683
2684- `setYear`
2685
2686## [0.7.0] - 2014-10-08
2687
2688### Added
2689
2690- `isSameWeek`
2691
2692## [0.6.0] - 2014-10-07
2693
2694### Fixed
2695
2696- Inconsistent behavior of `endOfMonth`.
2697
2698### Added
2699
2700- `isFirstDayOfMonth`
2701
2702- `isLastDayOfMonth`
2703
2704- `isSameMonth`
2705
2706## [0.5.0] - 2014-10-07
2707
2708### Added
2709
2710- `addDays`
2711
2712- `subDays`
2713
2714## [0.4.0] - 2014-10-07
2715
2716### Added
2717
2718- `startOfWeek`
2719
2720- `endOfWeek`
2721
2722- `eachDay`
2723
2724## [0.3.0] - 2014-10-06
2725
2726### Changed
2727
2728- `startOfDay` now sets milliseconds as well.
2729
2730### Added
2731
2732- `endOfDay`
2733
2734- `startOfMonth`
2735
2736- `endOfMonth`
2737
2738## [0.2.0] - 2014-10-06
2739
2740### Added
2741
2742- `isToday`
2743
2744- `isWeekend`
2745
2746## 0.1.0 - 2014-10-06
2747
2748### Added
2749
2750- `startOfDay`
2751
2752[unreleased]: https://github.com/date-fns/date-fns/compare/v2.16.1...HEAD
2753[2.16.1]: https://github.com/date-fns/date-fns/compare/v2.16.0...v2.16.1
2754[2.16.0]: https://github.com/date-fns/date-fns/compare/v2.15.0...v2.16.0
2755[2.15.0]: https://github.com/date-fns/date-fns/compare/v2.14.0...v2.15.0
2756[2.14.0]: https://github.com/date-fns/date-fns/compare/v2.13.0...v2.14.0
2757[2.13.0]: https://github.com/date-fns/date-fns/compare/v2.12.0...v2.13.0
2758[2.12.0]: https://github.com/date-fns/date-fns/compare/v2.11.1...v2.12.0
2759[2.11.1]: https://github.com/date-fns/date-fns/compare/v2.11.0...v2.11.1
2760[2.11.0]: https://github.com/date-fns/date-fns/compare/v2.10.0...v2.11.0
2761[2.10.0]: https://github.com/date-fns/date-fns/compare/v2.9.0...v2.10.0
2762[2.9.0]: https://github.com/date-fns/date-fns/compare/v2.8.1...v2.9.0
2763[2.8.1]: https://github.com/date-fns/date-fns/compare/v2.8.0...v2.8.1
2764[2.8.0]: https://github.com/date-fns/date-fns/compare/v2.7.0...v2.8.0
2765[2.7.0]: https://github.com/date-fns/date-fns/compare/v2.6.0...v2.7.0
2766[2.6.0]: https://github.com/date-fns/date-fns/compare/v2.5.1...v2.6.0
2767[2.5.1]: https://github.com/date-fns/date-fns/compare/v2.5.0...v2.5.1
2768[2.5.0]: https://github.com/date-fns/date-fns/compare/v2.4.1...v2.5.0
2769[2.4.1]: https://github.com/date-fns/date-fns/compare/v2.4.0...v2.4.1
2770[2.4.0]: https://github.com/date-fns/date-fns/compare/v2.3.0...v2.4.0
2771[2.3.0]: https://github.com/date-fns/date-fns/compare/v2.2.1...v2.3.0
2772[2.2.1]: https://github.com/date-fns/date-fns/compare/v2.1.0...v2.2.1
2773[2.1.0]: https://github.com/date-fns/date-fns/compare/v2.0.1...v2.1.0
2774[2.0.1]: https://github.com/date-fns/date-fns/compare/v2.0.0...v2.0.1
2775[2.0.0]: https://github.com/date-fns/date-fns/compare/v1.28.5...v2.0.0
2776[1.28.5]: https://github.com/date-fns/date-fns/compare/v1.28.4...v1.28.5
2777[1.28.4]: https://github.com/date-fns/date-fns/compare/v1.28.3...v1.28.4
2778[1.28.3]: https://github.com/date-fns/date-fns/compare/v1.28.2...v1.28.3
2779[1.28.2]: https://github.com/date-fns/date-fns/compare/v1.28.1...v1.28.2
2780[1.28.1]: https://github.com/date-fns/date-fns/compare/v1.28.0...v1.28.1
2781[1.28.0]: https://github.com/date-fns/date-fns/compare/v1.27.2...v1.28.0
2782[1.27.2]: https://github.com/date-fns/date-fns/compare/v1.27.1...v1.27.2
2783[1.27.1]: https://github.com/date-fns/date-fns/compare/v1.27.0...v1.27.1
2784[1.27.0]: https://github.com/date-fns/date-fns/compare/v1.26.0...v1.27.0
2785[1.26.0]: https://github.com/date-fns/date-fns/compare/v1.25.0...v1.26.0
2786[1.25.0]: https://github.com/date-fns/date-fns/compare/v1.24.0...v1.25.0
2787[1.24.0]: https://github.com/date-fns/date-fns/compare/v1.23.0...v1.24.0
2788[1.23.0]: https://github.com/date-fns/date-fns/compare/v1.22.0...v1.23.0
2789[1.22.0]: https://github.com/date-fns/date-fns/compare/v1.21.1...v1.22.0
2790[1.21.1]: https://github.com/date-fns/date-fns/compare/v1.21.0...v1.21.1
2791[1.21.0]: https://github.com/date-fns/date-fns/compare/v1.20.1...v1.21.0
2792[1.20.1]: https://github.com/date-fns/date-fns/compare/v1.20.0...v1.20.1
2793[1.20.0]: https://github.com/date-fns/date-fns/compare/v1.19.0...v1.20.0
2794[1.19.0]: https://github.com/date-fns/date-fns/compare/v1.18.0...v1.19.0
2795[1.18.0]: https://github.com/date-fns/date-fns/compare/v1.17.0...v1.18.0
2796[1.17.0]: https://github.com/date-fns/date-fns/compare/v1.16.0...v1.17.0
2797[1.16.0]: https://github.com/date-fns/date-fns/compare/v1.15.1...v1.16.0
2798[1.15.1]: https://github.com/date-fns/date-fns/compare/v1.15.0...v1.15.1
2799[1.15.0]: https://github.com/date-fns/date-fns/compare/v1.14.1...v1.15.0
2800[1.14.1]: https://github.com/date-fns/date-fns/compare/v1.14.0...v1.14.1
2801[1.14.0]: https://github.com/date-fns/date-fns/compare/v1.13.0...v1.14.0
2802[1.13.0]: https://github.com/date-fns/date-fns/compare/v1.12.1...v1.13.0
2803[1.12.1]: https://github.com/date-fns/date-fns/compare/v1.12.0...v1.12.1
2804[1.12.0]: https://github.com/date-fns/date-fns/compare/v1.11.2...v1.12.0
2805[1.11.2]: https://github.com/date-fns/date-fns/compare/v1.11.1...v1.11.2
2806[1.11.1]: https://github.com/date-fns/date-fns/compare/v1.11.0...v1.11.1
2807[1.11.0]: https://github.com/date-fns/date-fns/compare/v1.10.0...v1.11.0
2808[1.10.0]: https://github.com/date-fns/date-fns/compare/v1.9.0...v1.10.0
2809[1.9.0]: https://github.com/date-fns/date-fns/compare/v1.8.1...v1.9.0
2810[1.8.1]: https://github.com/date-fns/date-fns/compare/v1.8.0...v1.8.1
2811[1.8.0]: https://github.com/date-fns/date-fns/compare/v1.7.0...v1.8.0
2812[1.7.0]: https://github.com/date-fns/date-fns/compare/v1.6.0...v1.7.0
2813[1.6.0]: https://github.com/date-fns/date-fns/compare/v1.5.2...v1.6.0
2814[1.5.2]: https://github.com/date-fns/date-fns/compare/v1.5.1...v1.5.2
2815[1.5.1]: https://github.com/date-fns/date-fns/compare/v1.5.0...v1.5.1
2816[1.5.0]: https://github.com/date-fns/date-fns/compare/v1.4.0...v1.5.0
2817[1.4.0]: https://github.com/date-fns/date-fns/compare/v1.3.0...v1.4.0
2818[1.3.0]: https://github.com/date-fns/date-fns/compare/v1.2.0...v1.3.0
2819[1.2.0]: https://github.com/date-fns/date-fns/compare/v1.1.1...v1.2.0
2820[1.1.1]: https://github.com/date-fns/date-fns/compare/v1.1.0...v1.1.1
2821[1.1.0]: https://github.com/date-fns/date-fns/compare/v1.0.0...v1.1.0
2822[1.0.0]: https://github.com/date-fns/date-fns/compare/v0.17.0...v1.0.0
2823[0.17.0]: https://github.com/date-fns/date-fns/compare/v0.16.0...v0.17.0
2824[0.16.0]: https://github.com/date-fns/date-fns/compare/v0.15.0...v0.16.0
2825[0.15.0]: https://github.com/date-fns/date-fns/compare/v0.14.11...v0.15.0
2826[0.14.11]: https://github.com/date-fns/date-fns/compare/v0.14.10...v0.14.11
2827[0.14.10]: https://github.com/date-fns/date-fns/compare/v0.14.9...v0.14.10
2828[0.14.9]: https://github.com/date-fns/date-fns/compare/v0.14.8...v0.14.9
2829[0.14.8]: https://github.com/date-fns/date-fns/compare/v0.14.6...v0.14.8
2830[0.14.6]: https://github.com/date-fns/date-fns/compare/v0.14.0...v0.14.6
2831[0.14.0]: https://github.com/date-fns/date-fns/compare/v0.13.0...v0.14.0
2832[0.13.0]: https://github.com/date-fns/date-fns/compare/v0.12.1...v0.13.0
2833[0.12.1]: https://github.com/date-fns/date-fns/compare/v0.12.0...v0.12.1
2834[0.12.0]: https://github.com/date-fns/date-fns/compare/v0.11.0...v0.12.0
2835[0.11.0]: https://github.com/date-fns/date-fns/compare/v0.10.0...v0.11.0
2836[0.10.0]: https://github.com/date-fns/date-fns/compare/v0.9.0...v0.10.0
2837[0.9.0]: https://github.com/date-fns/date-fns/compare/v0.8.0...v0.9.0
2838[0.8.0]: https://github.com/date-fns/date-fns/compare/v0.7.0...v0.8.0
2839[0.7.0]: https://github.com/date-fns/date-fns/compare/v0.6.0...v0.7.0
2840[0.6.0]: https://github.com/date-fns/date-fns/compare/v0.5.0...v0.6.0
2841[0.5.0]: https://github.com/date-fns/date-fns/compare/v0.4.0...v0.5.0
2842[0.4.0]: https://github.com/date-fns/date-fns/compare/v0.3.0...v0.4.0
2843[0.3.0]: https://github.com/date-fns/date-fns/compare/v0.2.0...v0.3.0
2844[0.2.0]: https://github.com/date-fns/date-fns/compare/v0.1.0...v0.2.0
2845
\No newline at end of file