date-fns
Version:
Modern JavaScript date utility library
1 lines • 172 kB
JSON
{"General":[{"content":"# Getting Started\n\n## Table of Contents\n\n- [Introduction](#introduction)\n\n- [Installation](#installation)\n\n - [npm](#npm)\n\n - [Bower](#bower)\n\n - [CDN & Download](#cdn)\n\n - [GitHub Releases](#github-releases)\n\n## Introduction\n\n**date-fns** provides the most comprehensive, yet simple and consistent toolset\nfor manipulating **JavaScript dates** in **a browser** & **Node.js**.\n\n**date-fns** is like [lodash](https://lodash.com) for dates. It has\n[**140+ functions** for all occasions](https://date-fns.org/docs/).\n\n```js\ndateFns.format(new Date(2014, 1, 11), 'MM/DD/YYYY')\n//=> '02/11/2014'\n\nvar dates = [new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10)]\ndates.sort(dateFns.compareAsc)\n//=> [\n// Wed Feb 11 1987 00:00:00,\n// Mon Jul 10 1989 00:00:00,\n// Sun Jul 02 1995 00:00:00\n// ]\n```\n\n## Installation\n\nThe library is available as an [npm package](https://www.npmjs.com/package/date-fns),\na Bower package, and is also distributed through a [CDN](http://cdn.date-fns.org/).\n\n### npm\n\nTo install the npm package, run:\n\n```bash\nnpm install date-fns --save\n```\n\nTo start using:\n\n```js\nvar isToday = require('date-fns/is_today')\nisToday(new Date())\n//=> true\n```\n\n### Bower\n\nTo install the Bower package, run:\n\n```bash\nbower install date-fns\n```\n\nTo start using it, add the library to your build and access it\nvia `window.dateFns`:\n\n```js\ndateFns.isToday(new Date())\n//=> true\n```\n\n### CDN\n\nTo start using date-fns, simply add the following code into HTML:\n\n```html\n<script src=\"http://cdn.date-fns.org/VERSION/date_fns.min.js\"></script>\n<script>\n dateFns.isToday(new Date())\n //=> true\n</script>\n```\n\nReplace `VERSION` with a proper version number e.g. `v1.0.0`.\n\nSee the [full list](http://cdn.date-fns.org/) of resources avaliable on the CDN:\n\n- `http://cdn.date-fns.org/VERSION/date_fns.js`\n- `http://cdn.date-fns.org/VERSION/date_fns.js.map`\n- `http://cdn.date-fns.org/VERSION/date_fns.min.js`\n- `http://cdn.date-fns.org/VERSION/date_fns.min.js.map`\n- `http://cdn.date-fns.org/VERSION/date_fns_docs.json`\n\n### GitHub Releases\n\ndate-fns is avaliable via [the releases page](https://github.com/date-fns/date-fns/releases)\nwhere you can download the source code or individual files.\n","type":"markdown","urlId":"Getting-Started","category":"General","title":"Getting Started","description":"Introduction & installation instructions","path":"/Users/koss/src/date-fns/date-fns/docs/getting_started.md"},{"content":"# Change Log\n\nAll notable changes to this project will be documented in this file.\nThis project adheres to [Semantic Versioning].\n\nThis change log follows the format documented in [Keep a CHANGELOG].\n\n[Semantic Versioning]: http://semver.org/\n[Keep a CHANGELOG]: http://keepachangelog.com/\n\n## [Unreleased]\n\n## [1.4.0] - 2016-10-09\n\n### Added\n\n- Basic [SystemJS](https://github.com/systemjs/systemjs) support.\n\n### Fixed\n\n- Fix incorrect behaviour of `YYYY` and `YY` for years prior to 1000:\n now `format(new Date('0001-01-01'), 'YYYY-MM-DD')` returns `0001-01-01`\n instead of `1-01-01`.\n\n## [1.3.0] - 2016-05-26\n\n### Added\n\n- `closestIndexTo`\n\n## [1.2.0] - 2016-05-23\n\n### Added\n\n- Add an ability to pass negative numbers to `setDay`.\n\n## [1.1.1] - 2016-05-19\n\n### Fixed\n\n- Fix [Flow](http://flowtype.org/) declarations for some of the functions.\n\n## [1.1.0] - 2016-05-19\n\n### Added\n\n- [Flow](http://flowtype.org/) declarations for each function\n\tin [the \".js.flow\" style](http://flowtype.org/docs/declarations.html#declaration-files).\n\tKudos to [@JohnyDays](https://github.com/JohnyDays). See related PRs:\n\n\t- [#205](https://github.com/date-fns/date-fns/pull/205)\n\n\t- [#207](https://github.com/date-fns/date-fns/pull/207)\n\n## [1.0.0] - 2016-05-18\n\n### Fixed\n\n- `format` now returns the correct result for key `E`.\n\n- Prevent `startOf...`, `endOf...` and `lastDayOf...` functions\n to return dates with an incorrect time when the date is modifying\n into another time zone.\n\n- `parse` now parses years from 1 AD to 99 AD correctly.\n\n- Fix a bug in `getISOWeek` appearing because of a changing time zone\n (e.g., when the given date is in DST and the start of the ISO year is not).\n\n### Changed\n\n- **BREAKING**: all functions are moved to the root of the library, so they\n are now accessible with `require('date-fns/name_of_function')` or\n `import nameOfFunction from 'date-fns/name_of_function'`.\n\n ```javascript\n // Before v1.0.0\n var addMonths = require('date-fns/src/add_months')\n\n // v1.0.0 onward\n var addMonths = require('date-fns/add_months')\n ```\n\n- **BREAKING**: functions that had the last optional argument `weekStartsAt`\n (i.e. `endOfWeek`, `isSameWeek`, `lastDayOfWeek`, `setDay`, `startOfWeek`)\n now instead receive the object `options` with the property `options.weekStartsOn`\n as the last argument.\n\n ```javascript\n // Before v1.0.0\n var result = endOfWeek(new Date(2014, 8, 2), 1)\n\n // v1.0.0 onward\n var result = endOfWeek(new Date(2014, 8, 2), {weekStartsOn: 1})\n ```\n\n- **BREAKING**: remove the function `getTimeSinceMidnight` that was used inside\n the other functions.\n\n- **BREAKING**: `differenceInDays` now returns the number of full days instead\n of calendar days.\n\n- **BREAKING**: `eachDay` and `isWithinRange` now throw an exception\n when the given range boundaries are invalid.\n\n- Faster `isLeapYear`.\n\n- *Internal*: make the documentation more verbose.\n\n- *Internal*: convert the tests from Chai to power-assert allowing them\n to run against IE8.\n\n### Added\n\n- `addISOYears`\n\n- `closestTo`\n\n- `differenceInCalendarDays`\n\n- `differenceInCalendarISOWeeks`\n\n- `differenceInCalendarISOYears`\n\n- `differenceInCalendarMonths`\n\n- `differenceInCalendarQuarters`\n\n- `differenceInCalendarWeeks`\n\n- `differenceInCalendarYears`\n\n- `differenceInHours`\n\n- `differenceInISOYears`\n\n- `differenceInMilliseconds`\n\n- `differenceInMinutes`\n\n- `differenceInMonths`\n\n- `differenceInQuarters`\n\n- `differenceInSeconds`\n\n- `differenceInWeeks`\n\n- `differenceInYears`\n\n- `distanceInWords`\n\n- `distanceInWordsToNow`\n\n- `endOfISOWeek`\n\n- `endOfISOYear`\n\n- `endOfToday`\n\n- `endOfTomorrow`\n\n- `endOfYesterday`\n\n- `getDaysInYear`\n\n- `isDate`\n\n- `isFriday`\n\n- `isMonday`\n\n- `isSameISOWeek`\n\n- `isSameISOYear`\n\n- `isSaturday`\n\n- `isSunday`\n\n- `isThisHour`\n\n- `isThisISOWeek`\n\n- `isThisISOYear`\n\n- `isThisMinute`\n\n- `isThisMonth`\n\n- `isThisQuarter`\n\n- `isThisSecond`\n\n- `isThisWeek`\n\n- `isThisYear`\n\n- `isThursday`\n\n- `isTomorrow`\n\n- `isTuesday`\n\n- `isValid`\n\n- `isWednesday`\n\n- `isYesterday`\n\n- `lastDayOfISOWeek`\n\n- `lastDayOfISOYear`\n\n- `startOfISOWeek`\n\n- `startOfToday`\n\n- `startOfTomorrow`\n\n- `startOfYesterday`\n\n- `subISOYears`\n\n- Add `Qo`, `W`, `Wo`, `WW`, `GG`, `GGGG`, `Z`, `ZZ`, `X`, `x` keys to `format`.\n\n## [0.17.0] - 2015-09-29\n\n### Fixed\n\n- Fix a lot of bugs appearing when date is modifying into other time zone\n (e.g., when adding months and original date is in DST but new date is not).\n\n- Prevent instances of Date to lose milliseconds value when passed to.\n `parse` in IE10.\n\n### Changed\n\n- `setISOWeek` now keeps time from original date.\n\n- *Internal*: reuse `getDaysInMonth` inside of `addMonths`.\n\n### Added\n\n- `differenceInDays`\n\n- `getTimeSinceMidnight`\n\n- `format` now has new format key `aa`, which returns `a.m.`/`p.m.`\n as opposed to `a` that returns `am`/`pm`.\n\n- Complete UMD package (for Bower and CDN).\n\n## [0.16.0] - 2015-09-01\n\n### Changed\n\n- Use `parse` to clean date arguments in all functions.\n\n- `parse` now fallbacks to `new Date` when the argument\n is not an ISO formatted date.\n\n- *Internal*: reuse `getDaysInMonth` inside of `setMonth`.\n\n### Added\n\n- `addQuarters`\n\n- `addWeeks`\n\n- `endOfQuarter`\n\n- `getDate`\n\n- `getDay`\n\n- `getDaysInMonth`\n\n- `getHours`\n\n- `getISOWeeksInYear`\n\n- `getMilliseconds`\n\n- `getMinutes`\n\n- `getMonth`\n\n- `getSeconds`\n\n- `getYear`\n\n- `isLeapYear`\n\n- `isSameHour`\n\n- `isSameMinute`\n\n- `isSameQuarter`\n\n- `isSameSecond`\n\n- `lastDayOfQuarter`\n\n- `lastDayOfWeek`\n\n- `max`\n\n- `min`\n\n- `setDate`\n\n- `setDay`\n\n- `setHours`\n\n- `setMilliseconds`\n\n- `setMinutes`\n\n- `setSeconds`\n\n- `startOfQuarter`\n\n- `subQuarters`\n\n- `subWeeks`\n\n## [0.15.0] - 2015-08-26\n\n### Changed\n\n- `format` now returns `a.m.`/`p.m.` instead of `am`/`pm`.\n\n- `setMonth` now sets last day of month if original date was last day\n of longer month.\n\n- *Internal*: Fix code style according to ESLint.\n\n- *Internal*: Make tests run through all time zones.\n\n### Added\n\n- `getQuarter`\n\n- `setQuarter`\n\n- `getDayOfYear`\n\n- `setDayOfYear`\n\n- `isPast`\n\n- `addSeconds`\n\n- `subSeconds`\n\n- `startOfSecond`\n\n- `endOfSecond`\n\n- `startOfMinute`\n\n- `endOfMinute`\n\n- `addMilliseconds`\n\n- `subMilliseconds`\n\n- `endOfYear`\n\n- `addYears`\n\n- `subYears`\n\n- `lastDayOfYear`\n\n- `lastDayOfMonth`\n\n## [0.14.11] - 2015-08-21\n\n### Fixed\n\n- `format` now uses `parse` to avoid time zone bugs.\n\n### Changed\n\n- `setIsoWeek` now sets time to the start of the day.\n\n## [0.14.10] - 2015-07-29\n\n### Fixed\n\n- `format` now behaves correctly with 12:00 am.\n\n- `format` now behaves correctly with ordinal numbers.\n\n### Added\n\n- `compareAsc`\n\n- `compareDesc`\n\n- `addHours`\n\n- `subHours`\n\n- `isSameDay`\n\n- `parse`\n\n- `getISOYear`\n\n- `setISOYear`\n\n- `startOfISOYear`\n\n- `getISOWeek`\n\n- `setISOWeek`\n\n## [0.14.9] - 2015-01-14\n\n### Fixed\n\n- `addMonths` now correctly behaves with February\n (see [#18](https://github.com/js-fns/date-fns/pull/18)).\n\n## [0.14.8] - 2014-12-25\n\n### Fixed\n\n- `format` function now behaves correctly with `pm`/`am`.\n\n## [0.14.6] - 2014-12-04\n\n### Fixed\n\n- Fix broken Bower support.\n\n## [0.14.0] - 2014-11-05\n\n### Added\n\n- Bower package.\n\n## [0.13.0] - 2014-10-22\n\n### Added\n\n- `addMinutes`\n\n- `subMinutes`\n\n- `isEqual`\n\n- `isBefore`\n\n- `isAfter`\n\n## [0.12.1] - 2014-10-19\n\n### Fixed\n\n- Incorrect rounding in `DDD` formatter.\n\n## [0.12.0] - 2014-10-15\n\n### Added\n\n- `isSameYear`\n\n## [0.11.0] - 2014-10-15\n\n### Added\n\n- `isWithinRange`\n\n## [0.10.0] - 2014-10-13\n\n### Added\n\n- `format`\n\n- `startOfYear`\n\n## [0.9.0] - 2014-10-10\n\n### Changed\n\n- *Internal*: simplify `isWeekend`\n\n### Added\n\n- `isFuture`\n\n## [0.8.0] - 2014-10-09\n\n### Changed\n\n- *Internal*: reuse `addDays` inside of `subDays`.\n\n### Added\n\n- `addMonths`\n\n- `subMonths`\n\n- `setMonth`\n\n- `setYear`\n\n## [0.7.0] - 2014-10-08\n\n### Added\n\n- `isSameWeek`\n\n## [0.6.0] - 2014-10-07\n\n### Fixed\n\n- Inconsistent behavior of `endOfMonth`.\n\n### Added\n\n- `isFirstDayOfMonth`\n\n- `isLastDayOfMonth`\n\n- `isSameMonth`\n\n## [0.5.0] - 2014-10-07\n\n### Added\n\n- `addDays`\n\n- `subDays`\n\n## [0.4.0] - 2014-10-07\n\n### Added\n\n- `startOfWeek`\n\n- `endOfWeek`\n\n- `eachDay`\n\n## [0.3.0] - 2014-10-06\n\n### Changed\n\n- `startOfDay` now sets milliseconds as well.\n\n### Added\n\n- `endOfDay`\n\n- `startOfMonth`\n\n- `endOfMonth`\n\n## [0.2.0] - 2014-10-06\n\n### Added\n\n- `isToday`\n\n- `isWeekend`\n\n## 0.1.0 - 2014-10-06\n\n### Added\n\n- `startOfDay`\n\n[Unreleased]: https://github.com/date-fns/date-fns/compare/v1.4.0...HEAD\n[1.4.0]: https://github.com/date-fns/date-fns/compare/v1.3.0...v1.4.0\n[1.3.0]: https://github.com/date-fns/date-fns/compare/v1.2.0...v1.3.0\n[1.2.0]: https://github.com/date-fns/date-fns/compare/v1.1.1...v1.2.0\n[1.1.1]: https://github.com/date-fns/date-fns/compare/v1.1.0...v1.1.1\n[1.1.0]: https://github.com/date-fns/date-fns/compare/v1.0.0...v1.1.0\n[1.0.0]: https://github.com/date-fns/date-fns/compare/v0.17.0...v1.0.0\n[0.17.0]: https://github.com/date-fns/date-fns/compare/v0.16.0...v0.17.0\n[0.16.0]: https://github.com/date-fns/date-fns/compare/v0.15.0...v0.16.0\n[0.15.0]: https://github.com/date-fns/date-fns/compare/v0.14.11...v0.15.0\n[0.14.11]: https://github.com/date-fns/date-fns/compare/v0.14.10...v0.14.11\n[0.14.10]: https://github.com/date-fns/date-fns/compare/v0.14.9...v0.14.10\n[0.14.9]: https://github.com/date-fns/date-fns/compare/v0.14.8...v0.14.9\n[0.14.8]: https://github.com/date-fns/date-fns/compare/v0.14.6...v0.14.8\n[0.14.6]: https://github.com/date-fns/date-fns/compare/v0.14.0...v0.14.6\n[0.14.0]: https://github.com/date-fns/date-fns/compare/v0.13.0...v0.14.0\n[0.13.0]: https://github.com/date-fns/date-fns/compare/v0.12.1...v0.13.0\n[0.12.1]: https://github.com/date-fns/date-fns/compare/v0.12.0...v0.12.1\n[0.12.0]: https://github.com/date-fns/date-fns/compare/v0.11.0...v0.12.0\n[0.11.0]: https://github.com/date-fns/date-fns/compare/v0.10.0...v0.11.0\n[0.10.0]: https://github.com/date-fns/date-fns/compare/v0.9.0...v0.10.0\n[0.9.0]: https://github.com/date-fns/date-fns/compare/v0.8.0...v0.9.0\n[0.8.0]: https://github.com/date-fns/date-fns/compare/v0.7.0...v0.8.0\n[0.7.0]: https://github.com/date-fns/date-fns/compare/v0.6.0...v0.7.0\n[0.6.0]: https://github.com/date-fns/date-fns/compare/v0.5.0...v0.6.0\n[0.5.0]: https://github.com/date-fns/date-fns/compare/v0.4.0...v0.5.0\n[0.4.0]: https://github.com/date-fns/date-fns/compare/v0.3.0...v0.4.0\n[0.3.0]: https://github.com/date-fns/date-fns/compare/v0.2.0...v0.3.0\n[0.2.0]: https://github.com/date-fns/date-fns/compare/v0.1.0...v0.2.0\n","type":"markdown","urlId":"Change-Log","category":"General","title":"Change Log","description":"Changes for each version of the library","path":"/Users/koss/src/date-fns/date-fns/CHANGELOG.md"},{"content":"# Contributing Guide\n\n## Table of Contents\n\n- [How to Help?](#how-to-help)\n\n- [Contribution Guidelines](#contribution-guidelines)\n\n- [Getting Started](#getting-started)\n\n- [Code Style Guide](#code-style-guide)\n\n - [Lint the Code](#lint-the-code)\n\n - [Use EditorConfig](#use-editorconfig)\n\n- [Documentation](#documentation)\n\n - [JSDoc](#jsdoc)\n\n## How to Help?\n\nHelp is always welcome. There are areas where you can help:\n\n- The core functionality (performance improvements, bug fixes,\n new features, etc.).\n\n- Documentation ([markdown documents](https://github.com/date-fns/date-fns/search?l=markdown),\n inline JSDoc comments).\n\n- Test suite & development environment improvements.\n\n- The [website](https://github.com/date-fns/date-fns.org).\n\nIf you see a gap, but don't have time, experience, or you just need help\nwith the library, don't hesitate to [shoot an issue](https://github.com/date-fns/date-fns/issues/new).\n\nThe date-fns functionality is comprehensive and covers most of the use cases,\nhowever it doesn't support I18n which is the focus for the next major release.\nIf you want to help with that, please leave a comment to\nthe [I18n support issue](https://github.com/date-fns/date-fns/issues/157).\n\nAnother major milestone for the project is an extended time zone support.\nPlease leave a comment to the [Extended time zones support issue](https://github.com/date-fns/date-fns/issues/180)\nif you are interested in the functionality or want to help with development.\n\nIf you are interested in Elm/ClojureScript/etc. wrappers,\nplease [file an issue](https://github.com/date-fns/date-fns/issues/new).\n\n## Contribution Guidelines\n\nDue to the modular nature of date-fns, it's more than open to new features.\nHowever, when a new function duplicates the existing functionality, native API\nor causes significant build size increase, a PR might be rejected or\nthe author can be asked to move the code to a new or another package.\n\nPlease follow the main contributing rules, to maintain date-fns' top quality:\n\n- Follow style guides:\n\n - [Lint the code](#lint-the-code).\n\n - [Use EditorConfig](#use-editorconfig).\n\n- Write tests.\n\n- [Write documentation](#documentation).\n\n- [Write good commit messages].\n\n- Add an entry to Unreleased section in [CHANGELOG].\n\n- Squash related commits before a PR merge.\n\n- Don't change the library version.\n\n[Write good commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html\n[CHANGELOG]: https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md\n\n## Getting Started\n\n1. [Install Node.js](https://nodejs.org/en/download).\n\n2. Fork the project and clone the fork repo.\n\n3. Run `npm install` to install the application dependencies\n\n## Code Style Guide\n\n### Lint the Code\n\nThe project follows [JavaScript Standard Style]. To lint the code, run:\n\n```bash\nnpm run lint\n```\n\n[JavaScript Standard Style]: http://standardjs.com/\n\n### Use EditorConfig\n\nThe project uses [EditorConfig] to define basic coding style guides.\nPlease install a plugin for your editor of choice or manually enforce\nthe rules listed in [.editorconfig].\n\n[EditorConfig]: http://editorconfig.org\n[.editorconfig]: https://github.com/date-fns/date-fns.org/blob/master/.editorconfig\n\n## Documentation\n\n### JSDoc\n\n[JSDoc](http://usejsdoc.org) is used for the code documentation. Along with\nstandard JSDoc tags, date-fns uses `@category` tag that allows\nto group functions.\n\n[jsdoc-parse](https://github.com/jsdoc2md/jsdoc-parse) is used to generate\n[documentation JSON](https://github.com/date-fns/date-fns/blob/master/dist/date_fns_docs.json)\nconsumed by [date-fns.org](https://date-fns.org/docs).\n","type":"markdown","urlId":"Contributing","category":"General","title":"Contributing","description":"Contribution manual","path":"/Users/koss/src/date-fns/date-fns/CONTRIBUTING.md"},{"content":"# License\n\ndate-fns is licensed under the [MIT license](http://kossnocorp.mit-license.org).\nRead more about MIT at [TLDRLegal](https://tldrlegal.com/license/mit-license).\n","type":"markdown","urlId":"License","category":"General","title":"License","description":"MIT © Sasha Koss","path":"/Users/koss/src/date-fns/date-fns/LICENSE.md"}],"Common Helpers":[{"type":"jsdoc","urlId":"closestIndexTo","category":"Common Helpers","title":"closestIndexTo","description":"Return an index of the closest date from the array comparing to the given date.","content":{"id":"closestIndexTo","longname":"closestIndexTo","name":"closestIndexTo","scope":"global","kind":"function","description":"Return an index of the closest date from the array comparing to the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to compare with","name":"dateToCompare"},{"type":{"names":["Array.<Date>","Array.<String>","Array.<Number>"]},"description":"the array to search","name":"datesArray"}],"examples":["// Which date is closer to 6 September 2015?\nvar dateToCompare = new Date(2015, 8, 6)\nvar datesArray = [\n new Date(2015, 0, 1),\n new Date(2016, 0, 1),\n new Date(2017, 0, 1)\n]\nvar result = closestIndexTo(dateToCompare, datesArray)\n//=> 1"],"returns":[{"type":{"names":["Number"]},"description":"an index of the date closest to the given date"}],"category":"Common Helpers","exceptions":[{"type":{"names":["TypeError"]},"description":"the second argument must be an instance of Array"}],"meta":{"lineno":26,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/closest_index_to"},"summary":"Return an index of the closest date from the array comparing to the given date.","order":0}},{"type":"jsdoc","urlId":"closestTo","category":"Common Helpers","title":"closestTo","description":"Return a date from the array closest to the given date.","content":{"id":"closestTo","longname":"closestTo","name":"closestTo","scope":"global","kind":"function","description":"Return a date from the array closest to the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to compare with","name":"dateToCompare"},{"type":{"names":["Array.<Date>","Array.<String>","Array.<Number>"]},"description":"the array to search","name":"datesArray"}],"examples":["// Which date is closer to 6 October 2015: 1 January 2000 or 1 January 2030?\nvar dateToCompare = new Date(2015, 8, 6)\nvar result = closestTo(dateToCompare, [\n new Date(2000, 0, 1),\n new Date(2030, 0, 1)\n])\n//=> Tue Jan 01 2030 00:00:00"],"returns":[{"type":{"names":["Date"]},"description":"the date from the array closest to the given date"}],"category":"Common Helpers","exceptions":[{"type":{"names":["TypeError"]},"description":"the second argument must be an instance of Array"}],"meta":{"lineno":24,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/closest_to"},"summary":"Return a date from the array closest to the given date.","order":0}},{"type":"jsdoc","urlId":"compareAsc","category":"Common Helpers","title":"compareAsc","description":"Compare the two dates and return -1, 0 or 1.","content":{"id":"compareAsc","longname":"compareAsc","name":"compareAsc","scope":"global","kind":"function","description":"Compare the two dates and return 1 if the first date is after the second,\n-1 if the first date is before the second or 0 if dates are equal.","params":[{"type":{"names":["Date","String","Number"]},"description":"the first date to compare","name":"dateLeft"},{"type":{"names":["Date","String","Number"]},"description":"the second date to compare","name":"dateRight"}],"examples":["// Compare 11 February 1987 and 10 July 1989:\nvar result = compareAsc(\n new Date(1987, 1, 11),\n new Date(1989, 6, 10)\n)\n//=> -1","// Sort the array of dates:\nvar result = [\n new Date(1995, 6, 2),\n new Date(1987, 1, 11),\n new Date(1989, 6, 10)\n].sort(compareAsc)\n//=> [\n// Wed Feb 11 1987 00:00:00,\n// Mon Jul 10 1989 00:00:00,\n// Sun Jul 02 1995 00:00:00\n// ]"],"returns":[{"type":{"names":["Number"]},"description":"the result of the comparison"}],"category":"Common Helpers","meta":{"lineno":36,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/compare_asc"},"summary":"Compare the two dates and return -1, 0 or 1.","order":0}},{"type":"jsdoc","urlId":"compareDesc","category":"Common Helpers","title":"compareDesc","description":"Compare the two dates reverse chronologically and return -1, 0 or 1.","content":{"id":"compareDesc","longname":"compareDesc","name":"compareDesc","scope":"global","kind":"function","description":"Compare the two dates and return -1 if the first date is after the second,\n1 if the first date is before the second or 0 if dates are equal.","params":[{"type":{"names":["Date","String","Number"]},"description":"the first date to compare","name":"dateLeft"},{"type":{"names":["Date","String","Number"]},"description":"the second date to compare","name":"dateRight"}],"examples":["// Compare 11 February 1987 and 10 July 1989 reverse chronologically:\nvar result = compareDesc(\n new Date(1987, 1, 11),\n new Date(1989, 6, 10)\n)\n//=> 1","// Sort the array of dates in reverse chronological order:\nvar result = [\n new Date(1995, 6, 2),\n new Date(1987, 1, 11),\n new Date(1989, 6, 10)\n].sort(compareDesc)\n//=> [\n// Sun Jul 02 1995 00:00:00,\n// Mon Jul 10 1989 00:00:00,\n// Wed Feb 11 1987 00:00:00\n// ]"],"returns":[{"type":{"names":["Number"]},"description":"the result of the comparison"}],"category":"Common Helpers","meta":{"lineno":36,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/compare_desc"},"summary":"Compare the two dates reverse chronologically and return -1, 0 or 1.","order":0}},{"type":"jsdoc","urlId":"distanceInWords","category":"Common Helpers","title":"distanceInWords","description":"Return the distance between the given dates in words.","content":{"id":"distanceInWords","longname":"distanceInWords","name":"distanceInWords","scope":"global","kind":"function","description":"Return the distance between the given dates in words.\n\n| Distance between dates | Result |\n|-------------------------------------------------------------------|---------------------|\n| 0 ... 30 secs | less than a minute |\n| 30 secs ... 1 min 30 secs | 1 minute |\n| 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n| 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n| 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n| 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n| 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n| 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n| 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n| 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n| 1 yr ... 1 yr 3 months | about 1 year |\n| 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n| 1 yr 9 months ... 2 yrs | almost 2 years |\n| N yrs ... N yrs 3 months | about N years |\n| N yrs 3 months ... N yrs 9 months | over N years |\n| N yrs 9 months ... N+1 yrs | almost N+1 years |\n\nWith `options.includeSeconds == true`:\n| Distance between dates | Result |\n|------------------------|----------------------|\n| 0 secs ... 5 secs | less than 5 seconds |\n| 5 secs ... 10 secs | less than 10 seconds |\n| 10 secs ... 20 secs | less than 20 seconds |\n| 20 secs ... 40 secs | half a minute |\n| 40 secs ... 60 secs | less than a minute |\n| 60 secs ... 90 secs | 1 minute |","params":[{"type":{"names":["Date","String","Number"]},"description":"the first date of the distance","name":"dateFrom"},{"type":{"names":["Date","String","Number"]},"description":"the second date of the distance","name":"dateTo"},{"type":{"names":["Object"]},"optional":true,"description":"the object with options","name":"options"},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"distances less than a minute are more detailed","name":"options.includeSeconds"}],"examples":["// What is the distance between 2 July 2014 and 1 January 2015?\nvar result = distanceInWords(\n new Date(2014, 6, 2),\n new Date(2015, 0, 1)\n)\n//=> '6 months'","// What is the distance between 1 January 2015 00:00:15\n// and 1 January 2015 00:00:00, including seconds?\nvar result = distanceInWords(\n new Date(2015, 0, 1, 0, 0, 15),\n new Date(2015, 0, 1, 0, 0, 0),\n {includeSeconds: true}\n)\n//=> 'less than 20 seconds'"],"returns":[{"type":{"names":["String"]},"description":"the distance in words"}],"category":"Common Helpers","meta":{"lineno":71,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/distance_in_words"},"summary":"Return the distance between the given dates in words.","order":0}},{"type":"jsdoc","urlId":"distanceInWordsToNow","category":"Common Helpers","title":"distanceInWordsToNow","description":"Return the distance between the given date and now in words.","content":{"id":"distanceInWordsToNow","longname":"distanceInWordsToNow","name":"distanceInWordsToNow","scope":"global","kind":"function","description":"Return the distance between the given date and now in words.\n\n| Distance to now | Result |\n|-------------------------------------------------------------------|---------------------|\n| 0 ... 30 secs | less than a minute |\n| 30 secs ... 1 min 30 secs | 1 minute |\n| 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n| 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n| 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n| 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n| 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n| 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n| 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n| 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n| 1 yr ... 1 yr 3 months | about 1 year |\n| 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n| 1 yr 9 months ... 2 yrs | almost 2 years |\n| N yrs ... N yrs 3 months | about N years |\n| N yrs 3 months ... N yrs 9 months | over N years |\n| N yrs 9 months ... N+1 yrs | almost N+1 years |\n\nWith `options.includeSeconds == true`:\n| Distance to now | Result |\n|---------------------|----------------------|\n| 0 secs ... 5 secs | less than 5 seconds |\n| 5 secs ... 10 secs | less than 10 seconds |\n| 10 secs ... 20 secs | less than 20 seconds |\n| 20 secs ... 40 secs | half a minute |\n| 40 secs ... 60 secs | less than a minute |\n| 60 secs ... 90 secs | 1 minute |","params":[{"type":{"names":["Date","String","Number"]},"description":"the given date","name":"date"},{"type":{"names":["Object"]},"optional":true,"description":"the object with options","name":"options"},{"type":{"names":["Boolean"]},"optional":true,"defaultvalue":false,"description":"distances less than a minute are more detailed","name":"options.includeSeconds"}],"examples":["// If today is 1 January 2015, what is the distance to 2 July 2014?\nvar result = distanceInWordsToNow(\n new Date(2014, 6, 2)\n)\n//=> '6 months'","// If now is 1 January 2015 00:00:00,\n// what is the distance to 1 January 2015 00:00:15, including seconds?\nvar result = distanceInWordsToNow(\n new Date(2015, 0, 1, 0, 0, 15),\n {includeSeconds: true}\n)\n//=> 'less than 20 seconds'"],"returns":[{"type":{"names":["String"]},"description":"the distance in words"}],"category":"Common Helpers","meta":{"lineno":60,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/distance_in_words_to_now"},"summary":"Return the distance between the given date and now in words.","order":0}},{"type":"jsdoc","urlId":"format","category":"Common Helpers","title":"format","description":"Format the date.","content":{"id":"format","longname":"format","name":"format","scope":"global","kind":"function","description":"Return the formatted date string in the given format.\n\nAccepted tokens:\n| Unit | Token | Result examples |\n|-------------------------|-------|----------------------------------|\n| Month | M | 1, 2, ..., 12 |\n| | Mo | 1st, 2nd, ..., 12th |\n| | MM | 01, 02, ..., 12 |\n| | MMM | Jan, Feb, ..., Dec |\n| | MMMM | January, February, ..., December |\n| Quarter | Q | 1, 2, 3, 4 |\n| | Qo | 1st, 2nd, 3rd, 4th |\n| Day of month | D | 1, 2, ..., 31 |\n| | Do | 1st, 2nd, ..., 31st |\n| | DD | 01, 02, ..., 31 |\n| Day of year | DDD | 1, 2, ..., 366 |\n| | DDDo | 1st, 2nd, ..., 366th |\n| | DDDD | 001, 002, ..., 366 |\n| Day of week | d | 0, 1, ..., 6 |\n| | do | 0th, 1st, ..., 6th |\n| | dd | Su, Mo, ..., Sa |\n| | ddd | Sun, Mon, ..., Sat |\n| | dddd | Sunday, Monday, ..., Saturday |\n| Day of ISO week | E | 1, 2, ..., 7 |\n| ISO week | W | 1, 2, ..., 53 |\n| | Wo | 1st, 2nd, ..., 53rd |\n| | WW | 01, 02, ..., 53 |\n| Year | YY | 00, 01, ..., 99 |\n| | YYYY | 1900, 1901, ..., 2099 |\n| ISO week-numbering year | GG | 00, 01, ..., 99 |\n| | GGGG | 1900, 1901, ..., 2099 |\n| AM/PM | A | AM, PM |\n| | a | am, pm |\n| | aa | a.m., p.m. |\n| Hour | H | 0, 1, ... 23 |\n| | HH | 00, 01, ... 23 |\n| | h | 1, 2, ..., 12 |\n| | hh | 01, 02, ..., 12 |\n| Minute | m | 0, 1, ..., 59 |\n| | mm | 00, 01, ..., 59 |\n| Second | s | 0, 1, ..., 59 |\n| | ss | 00, 01, ..., 59 |\n| 1/10 of second | S | 0, 1, ..., 9 |\n| 1/100 of second | SS | 00, 01, ..., 99 |\n| Millisecond | SSS | 000, 001, ..., 999 |\n| Timezone | Z | -01:00, +00:00, ... +12:00 |\n| | ZZ | -0100, +0000, ..., +1200 |\n| Seconds timestamp | X | 512969520 |\n| Milliseconds timestamp | x | 512969520900 |","params":[{"type":{"names":["Date","String","Number"]},"description":"the original date","name":"date"},{"type":{"names":["String"]},"optional":true,"defaultvalue":"'YYYY-MM-DDTHH:mm:ss.SSSZ'","description":"the string of tokens","name":"format"}],"examples":["// Represent 11 February 2014 in middle-endian format:\nvar result = format(\n new Date(2014, 1, 11),\n 'MM/DD/YYYY'\n)\n//=> '02/11/2014'"],"returns":[{"type":{"names":["String"]},"description":"the formatted date string"}],"category":"Common Helpers","meta":{"lineno":73,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/format"},"summary":"Format the date.","order":0}},{"type":"jsdoc","urlId":"isAfter","category":"Common Helpers","title":"isAfter","description":"Is the first date after the second one?","content":{"id":"isAfter","longname":"isAfter","name":"isAfter","scope":"global","kind":"function","description":"Is the first date after the second one?","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to compare with","name":"dateToCompare"},{"type":{"names":["Date","String","Number"]},"description":"the date that should be after the first one to return true","name":"date"}],"examples":["// Is 10 July 1989 after 11 February 1987?\nvar result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n//=> true"],"returns":[{"type":{"names":["Boolean"]},"description":"the first date is after the second date"}],"category":"Common Helpers","meta":{"lineno":19,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_after"},"summary":"Is the first date after the second one?","order":0}},{"type":"jsdoc","urlId":"isBefore","category":"Common Helpers","title":"isBefore","description":"Is the first date before the second one?","content":{"id":"isBefore","longname":"isBefore","name":"isBefore","scope":"global","kind":"function","description":"Is the first date before the second one?","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to compare with","name":"dateToCompare"},{"type":{"names":["Date","String","Number"]},"description":"the date that should be before the first one to return true","name":"date"}],"examples":["// Is 10 July 1989 before 11 February 1987?\nvar result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n//=> false"],"returns":[{"type":{"names":["Boolean"]},"description":"the first date is before the second date"}],"category":"Common Helpers","meta":{"lineno":19,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_before"},"summary":"Is the first date before the second one?","order":0}},{"type":"jsdoc","urlId":"isDate","category":"Common Helpers","title":"isDate","description":"Is the given argument an instance of Date?","content":{"id":"isDate","longname":"isDate","name":"isDate","scope":"global","kind":"function","description":"Is the given argument an instance of Date?","params":[{"type":{"names":["*"]},"description":"the argument to check","name":"argument"}],"examples":["// Is 'mayonnaise' a Date?\nvar result = isDate('mayonnaise')\n//=> false"],"returns":[{"type":{"names":["Boolean"]},"description":"the given argument is an instance of Date"}],"category":"Common Helpers","meta":{"lineno":16,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_date"},"summary":"Is the given argument an instance of Date?","order":0}},{"type":"jsdoc","urlId":"isEqual","category":"Common Helpers","title":"isEqual","description":"Are the given dates equal?","content":{"id":"isEqual","longname":"isEqual","name":"isEqual","scope":"global","kind":"function","description":"Are the given dates equal?","params":[{"type":{"names":["Date","String","Number"]},"description":"the first date to compare","name":"dateLeft"},{"type":{"names":["Date","String","Number"]},"description":"the second date to compare","name":"dateRight"}],"examples":["// Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\nvar result = isEqual(\n new Date(2014, 6, 2, 6, 30, 45, 0)\n new Date(2014, 6, 2, 6, 30, 45, 500)\n)\n//=> false"],"returns":[{"type":{"names":["Boolean"]},"description":"the dates are equal"}],"category":"Common Helpers","meta":{"lineno":22,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_equal"},"summary":"Are the given dates equal?","order":0}},{"type":"jsdoc","urlId":"isFuture","category":"Common Helpers","title":"isFuture","description":"Is the given date in the future?","content":{"id":"isFuture","longname":"isFuture","name":"isFuture","scope":"global","kind":"function","description":"Is the given date in the future?","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to check","name":"date"}],"examples":["// If today is 6 October 2014, is 31 December 2014 in the future?\nvar result = isFuture(new Date(2014, 11, 31))\n//=> true"],"returns":[{"type":{"names":["Boolean"]},"description":"the date is in the future"}],"category":"Common Helpers","meta":{"lineno":18,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_future"},"summary":"Is the given date in the future?","order":0}},{"type":"jsdoc","urlId":"isPast","category":"Common Helpers","title":"isPast","description":"Is the given date in the past?","content":{"id":"isPast","longname":"isPast","name":"isPast","scope":"global","kind":"function","description":"Is the given date in the past?","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to check","name":"date"}],"examples":["// If today is 6 October 2014, is 2 July 2014 in the past?\nvar result = isPast(new Date(2014, 6, 2))\n//=> true"],"returns":[{"type":{"names":["Boolean"]},"description":"the date is in the past"}],"category":"Common Helpers","meta":{"lineno":18,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_past"},"summary":"Is the given date in the past?","order":0}},{"type":"jsdoc","urlId":"isValid","category":"Common Helpers","title":"isValid","description":"Is the given date valid?","content":{"id":"isValid","longname":"isValid","name":"isValid","scope":"global","kind":"function","description":"Returns false if argument is Invalid Date and true otherwise.\nInvalid Date is a Date, whose time value is NaN.\n\nTime value of Date: http://es5.github.io/#x15.9.1.1","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to check","name":"date"}],"examples":["// For the valid date:\nvar result = isValid(new Date(2014, 1, 31))\n//=> true","// For the invalid date:\nvar result = isValid(new Date(''))\n//=> false"],"returns":[{"type":{"names":["Boolean"]},"description":"the date is valid"}],"category":"Common Helpers","exceptions":[{"type":{"names":["TypeError"]},"description":"argument must be an instance of Date"}],"meta":{"lineno":27,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_valid"},"summary":"Is the given date valid?","order":0}},{"type":"jsdoc","urlId":"max","category":"Common Helpers","title":"max","description":"Return the latest of the given dates.","content":{"id":"max","longname":"max","name":"max","scope":"global","kind":"function","description":"Return the latest of the given dates.","params":[{"type":{"names":["Date","String","Number"]},"variable":true,"description":"the dates to compare","name":"dates"}],"examples":["// Which of these dates is the latest?\nvar result = max(\n new Date(1989, 6, 10),\n new Date(1987, 1, 11),\n new Date(1995, 6, 2),\n new Date(1990, 0, 1)\n)\n//=> Sun Jul 02 1995 00:00:00"],"returns":[{"type":{"names":["Date"]},"description":"the latest of the dates"}],"category":"Common Helpers","meta":{"lineno":23,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/max"},"summary":"Return the latest of the given dates.","order":0}},{"type":"jsdoc","urlId":"min","category":"Common Helpers","title":"min","description":"Return the earliest of the given dates.","content":{"id":"min","longname":"min","name":"min","scope":"global","kind":"function","description":"Return the earliest of the given dates.","params":[{"type":{"names":["Date","String","Number"]},"variable":true,"description":"the dates to compare","name":"dates"}],"examples":["// Which of these dates is the earliest?\nvar result = min(\n new Date(1989, 6, 10),\n new Date(1987, 1, 11),\n new Date(1995, 6, 2),\n new Date(1990, 0, 1)\n)\n//=> Wed Feb 11 1987 00:00:00"],"returns":[{"type":{"names":["Date"]},"description":"the earliest of the dates"}],"category":"Common Helpers","meta":{"lineno":23,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/min"},"summary":"Return the earliest of the given dates.","order":0}},{"type":"jsdoc","urlId":"parse","category":"Common Helpers","title":"parse","description":"Parse the ISO-8601-formatted date.","content":{"id":"parse","longname":"parse","name":"parse","scope":"global","kind":"function","description":"Parse the date string representation.\nIt accepts the ISO 8601 format as well as a partial implementation.\n\nISO 8601: http://en.wikipedia.org/wiki/ISO_8601","params":[{"type":{"names":["String"]},"description":"the ISO 8601 formatted string to parse","name":"dateString"}],"examples":["// Parse string '2014-02-11T11:30:30':\nvar result = parse('2014-02-11T11:30:30')\n//=> Tue Feb 11 2014 11:30:30"],"returns":[{"type":{"names":["Date"]},"description":"the parsed date in the local time zone"}],"category":"Common Helpers","meta":{"lineno":47,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/parse"},"summary":"Parse the ISO-8601-formatted date.","order":0}}],"Range Helpers":[{"type":"jsdoc","urlId":"isWithinRange","category":"Range Helpers","title":"isWithinRange","description":"Is the given date within the range?","content":{"id":"isWithinRange","longname":"isWithinRange","name":"isWithinRange","scope":"global","kind":"function","description":"Is the given date within the range?","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to check","name":"date"},{"type":{"names":["Date","String","Number"]},"description":"the start of range","name":"startDate"},{"type":{"names":["Date","String","Number"]},"description":"the end of range","name":"endDate"}],"examples":["// For the date within the range:\nisWithinRange(\n new Date(2014, 0, 3), new Date(2014, 0, 1), new Date(2014, 0, 7)\n)\n//=> true","// For the date outside of the range:\nisWithinRange(\n new Date(2014, 0, 10), new Date(2014, 0, 1), new Date(2014, 0, 7)\n)\n//=> false"],"returns":[{"type":{"names":["Boolean"]},"description":"the date is within the range"}],"category":"Range Helpers","exceptions":[{"type":{"names":["Error"]},"description":"startDate cannot be after endDate"}],"meta":{"lineno":30,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/is_within_range"},"summary":"Is the given date within the range?","order":0}}],"Millisecond Helpers":[{"type":"jsdoc","urlId":"addMilliseconds","category":"Millisecond Helpers","title":"addMilliseconds","description":"Add the specified number of milliseconds to the given date.","content":{"id":"addMilliseconds","longname":"addMilliseconds","name":"addMilliseconds","scope":"global","kind":"function","description":"Add the specified number of milliseconds to the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to be changed","name":"date"},{"type":{"names":["Number"]},"description":"the amount of milliseconds to be added","name":"amount"}],"examples":["// Add 750 milliseconds to 10 July 2014 12:45:30.000:\nvar result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n//=> Thu Jul 10 2014 12:45:30.750"],"returns":[{"type":{"names":["Date"]},"description":"the new date with the milliseconds added"}],"category":"Millisecond Helpers","meta":{"lineno":19,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/add_milliseconds"},"summary":"Add the specified number of milliseconds to the given date.","order":0}},{"type":"jsdoc","urlId":"differenceInMilliseconds","category":"Millisecond Helpers","title":"differenceInMilliseconds","description":"Get the number of milliseconds between the given dates.","content":{"id":"differenceInMilliseconds","longname":"differenceInMilliseconds","name":"differenceInMilliseconds","scope":"global","kind":"function","description":"Get the number of milliseconds between the given dates.","params":[{"type":{"names":["Date","String","Number"]},"description":"the later date","name":"dateLeft"},{"type":{"names":["Date","String","Number"]},"description":"the earlier date","name":"dateRight"}],"examples":["// How many milliseconds are between\n// 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\nvar result = differenceInMilliseconds(\n new Date(2014, 6, 2, 12, 30, 21, 700),\n new Date(2014, 6, 2, 12, 30, 20, 600)\n)\n//=> 1100"],"returns":[{"type":{"names":["Number"]},"description":"the number of milliseconds"}],"category":"Millisecond Helpers","meta":{"lineno":23,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/difference_in_milliseconds"},"summary":"Get the number of milliseconds between the given dates.","order":0}},{"type":"jsdoc","urlId":"getMilliseconds","category":"Millisecond Helpers","title":"getMilliseconds","description":"Get the milliseconds of the given date.","content":{"id":"getMilliseconds","longname":"getMilliseconds","name":"getMilliseconds","scope":"global","kind":"function","description":"Get the milliseconds of the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the given date","name":"date"}],"examples":["// Get the milliseconds of 29 February 2012 11:45:05.123:\nvar result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n//=> 123"],"returns":[{"type":{"names":["Number"]},"description":"the milliseconds"}],"category":"Millisecond Helpers","meta":{"lineno":18,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/get_milliseconds"},"summary":"Get the milliseconds of the given date.","order":0}},{"type":"jsdoc","urlId":"setMilliseconds","category":"Millisecond Helpers","title":"setMilliseconds","description":"Set the milliseconds to the given date.","content":{"id":"setMilliseconds","longname":"setMilliseconds","name":"setMilliseconds","scope":"global","kind":"function","description":"Set the milliseconds to the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to be changed","name":"date"},{"type":{"names":["Number"]},"description":"the milliseconds of the new date","name":"milliseconds"}],"examples":["// Set 300 milliseconds to 1 September 2014 11:30:40.500:\nvar result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n//=> Mon Sep 01 2014 11:30:40.300"],"returns":[{"type":{"names":["Date"]},"description":"the new date with the milliseconds setted"}],"category":"Millisecond Helpers","meta":{"lineno":19,"filename":"index.js","path":"/Users/koss/src/date-fns/date-fns/src/set_milliseconds"},"summary":"Set the milliseconds to the given date.","order":0}},{"type":"jsdoc","urlId":"subMilliseconds","category":"Millisecond Helpers","title":"subMilliseconds","description":"Subtract the specified number of milliseconds from the given date.","content":{"id":"subMilliseconds","longname":"subMilliseconds","name":"subMilliseconds","scope":"global","kind":"function","description":"Subtract the specified number of milliseconds from the given date.","params":[{"type":{"names":["Date","String","Number"]},"description":"the date to be changed","name":"date"},{"type":{"names":["Number"]},"description":"the am