-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License | ||
|
||
date-fns is licensed under the [MIT license](http://kossnocorp.mit-license.org). | ||
Read more about MIT at [TLDRLegal](https://tldrlegal.com/license/mit-license). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#  date-fns | ||
|
||
[🙏 **Please help us to make the best date library for JavaScript. We need your support!**](https://opencollective.com/date-fns) | ||
|
||
⚠️ **Warning**: the current master represents v2 pre-release version of the library. [See v1 branch](https://github.com/date-fns/date-fns/tree/v1). | ||
|
||
**Pinned**: see [a brief comparison with Moment.js](https://github.com/date-fns/date-fns/issues/275#issuecomment-264934189). | ||
|
||
**date-fns** provides the most comprehensive, yet simple and consistent toolset | ||
for manipulating **JavaScript dates** in **a browser** & **Node.js**. | ||
|
||
**date-fns** is like [lodash](https://lodash.com) for dates. It has | ||
[**180+ functions** for all occasions](https://date-fns.org/docs/). | ||
|
||
```js | ||
import { compareAsc, format } from 'date-fns' | ||
|
||
format(new Date(2014, 1, 11), 'yyyy-MM-dd') | ||
//=> '2014-02-11' | ||
|
||
const dates = [ | ||
new Date(1995, 6, 2), | ||
new Date(1987, 1, 11), | ||
new Date(1989, 6, 10) | ||
] | ||
dates.sort(compareAsc) | ||
//=> [ | ||
// Wed Feb 11 1987 00:00:00, | ||
// Mon Jul 10 1989 00:00:00, | ||
// Sun Jul 02 1995 00:00:00 | ||
// ] | ||
``` | ||
|
||
The library is available as an [npm package](https://www.npmjs.com/package/date-fns). | ||
To install the package run: | ||
|
||
```bash | ||
npm install date-fns --save | ||
# or with yarn | ||
yarn add date-fns | ||
``` | ||
|
||
## Docs | ||
|
||
[See date-fns.org](https://date-fns.org/) for more details, API, | ||
and other docs. | ||
|
||
## License | ||
|
||
[MIT © Sasha Koss](https://kossnocorp.mit-license.org/) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[](https://gitter.im/moment/moment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
|
||
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][downloads-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url] | ||
[](https://coveralls.io/r/moment/moment?branch=develop) | ||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment?ref=badge_shield) | ||
[](https://dependabot.com/compatibility-score.html?dependency-name=moment&package-manager=npm_and_yarn&version-scheme=semver) | ||
|
||
A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. | ||
|
||
**[Documentation](http://momentjs.com/docs/)** | ||
|
||
## Port to ECMAScript 6 (version 2.10.0) | ||
|
||
Moment 2.10.0 does not bring any new features, but the code is now written in | ||
ECMAScript 6 modules and placed inside `src/`. Previously `moment.js`, `locale/*.js` and | ||
`test/moment/*.js`, `test/locale/*.js` contained the source of the project. Now | ||
the source is in `src/`, temporary build (ECMAScript 5) files are placed under | ||
`build/umd/` (for running tests during development), and the `moment.js` and | ||
`locale/*.js` files are updated only on release. | ||
|
||
If you want to use a particular revision of the code, make sure to run | ||
`grunt transpile update-index`, so `moment.js` and `locales/*.js` are synced | ||
with `src/*`. We might place that in a commit hook in the future. | ||
|
||
## Upgrading to 2.0.0 | ||
|
||
There are a number of small backwards incompatible changes with version 2.0.0. [See the full descriptions here](https://gist.github.com/timrwood/e72f2eef320ed9e37c51#backwards-incompatible-changes) | ||
|
||
* Changed language ordinal method to return the number + ordinal instead of just the ordinal. | ||
|
||
* Changed two digit year parsing cutoff to match strptime. | ||
|
||
* Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`. | ||
|
||
* Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`. | ||
|
||
* Removed the lang data objects from the top level namespace. | ||
|
||
* Duplicate `Date` passed to `moment()` instead of referencing it. | ||
|
||
## [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) | ||
|
||
## [Contributing](https://github.com/moment/moment/blob/develop/CONTRIBUTING.md) [](https://www.codetriage.com/moment/moment) | ||
|
||
We're looking for co-maintainers! If you want to become a master of time please | ||
write to [ichernev](https://github.com/ichernev). | ||
|
||
In addition to contributing code, you can help to triage issues. This can include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to moment/moment on CodeTriage](https://www.codetriage.com/moment/moment). | ||
|
||
## License | ||
|
||
Moment.js is freely distributable under the terms of the [MIT license](https://github.com/moment/moment/blob/develop/LICENSE). | ||
|
||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoment%2Fmoment?ref=badge_large) | ||
|
||
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat | ||
[license-url]: LICENSE | ||
|
||
[npm-url]: https://npmjs.org/package/moment | ||
[npm-version-image]: http://img.shields.io/npm/v/moment.svg?style=flat | ||
[npm-downloads-image]: http://img.shields.io/npm/dm/moment.svg?style=flat | ||
[downloads-url]: https://npmcharts.com/compare/moment?minimal=true | ||
|
||
[travis-url]: http://travis-ci.org/moment/moment | ||
[travis-image]: http://img.shields.io/travis/moment/moment/develop.svg?style=flat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"name": "moment", | ||
"version": "2.24.0", | ||
"description": "Parse, validate, manipulate, and display dates", | ||
"homepage": "http://momentjs.com", | ||
"author": "Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)", | ||
"contributors": [ | ||
"Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)", | ||
"Rocky Meza (http://rockymeza.com)", | ||
"Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)", | ||
"Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)", | ||
"Andre Polykanine <andre@oire.org> (https://github.com/oire)" | ||
], | ||
"keywords": [ | ||
"moment", | ||
"date", | ||
"time", | ||
"parse", | ||
"format", | ||
"validate", | ||
"i18n", | ||
"l10n", | ||
"ender" | ||
], | ||
"main": "./moment.js", | ||
"jsnext:main": "./src/moment.js", | ||
"typings": "./moment.d.ts", | ||
"engines": { | ||
"node": "*" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/moment/moment.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/moment/moment/issues" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"benchmark": "latest", | ||
"coveralls": "^3.0.2", | ||
"es6-promise": "latest", | ||
"grunt": "~0.4", | ||
"grunt-benchmark": "latest", | ||
"grunt-cli": "latest", | ||
"grunt-contrib-clean": "latest", | ||
"grunt-contrib-concat": "latest", | ||
"grunt-contrib-copy": "latest", | ||
"grunt-contrib-jshint": "latest", | ||
"grunt-contrib-uglify": "latest", | ||
"grunt-contrib-watch": "^1.1.0", | ||
"grunt-env": "latest", | ||
"grunt-exec": "latest", | ||
"grunt-jscs": "latest", | ||
"grunt-karma": "latest", | ||
"grunt-nuget": "latest", | ||
"grunt-string-replace": "latest", | ||
"karma": "latest", | ||
"karma-chrome-launcher": "latest", | ||
"karma-firefox-launcher": "latest", | ||
"karma-qunit": "latest", | ||
"karma-sauce-launcher": "latest", | ||
"load-grunt-tasks": "~3.5.2", | ||
"node-qunit": "^1.0.0", | ||
"nyc": "~11.9.0", | ||
"qunit": "^2.7.1", | ||
"rollup": "~0.67.4", | ||
"spacejam": "latest", | ||
"typescript": "^1.8.10", | ||
"uglify-js": "latest" | ||
}, | ||
"ender": "./ender.js", | ||
"dojoBuild": "package.js", | ||
"jspm": { | ||
"files": [ | ||
"moment.js", | ||
"moment.d.ts", | ||
"locale" | ||
], | ||
"map": { | ||
"moment": "./moment" | ||
}, | ||
"buildConfig": { | ||
"uglify": true | ||
} | ||
}, | ||
"scripts": { | ||
"typescript-test": "tsc --project typing-tests", | ||
"test": "grunt test", | ||
"coverage": "nyc npm test && nyc report", | ||
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"spm": { | ||
"main": "moment.js", | ||
"output": [ | ||
"locale/*.js" | ||
] | ||
} | ||
} |