You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.5 KiB

  1. [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]
  2. A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.
  3. ## [Documentation](http://momentjs.com/docs/)
  4. ## Port to ES6 (version 2.10.0)
  5. Moment 2.10.0 does not bring any new features, but the code is now written in
  6. es6 modules and placed inside `src/`. Previously `moment.js`, `locale/*.js` and
  7. `test/moment/*.js`, `test/locale/*.js` contained the source of the project. Now
  8. the source is in `src/`, temporary build (es5) files are placed under
  9. `build/umd/` (for running tests during development), and the `moment.js` and
  10. `locale/*.js` files are updated only on release.
  11. If you want to use a particular revision of the code, make sure to run
  12. `grunt transpile update-index`, so `moment.js` and `locales/*.js` are synced
  13. with `src/*`. We might place that in a commit hook in the future.
  14. ## Upgrading to 2.0.0
  15. 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)
  16. * Changed language ordinal method to return the number + ordinal instead of just the ordinal.
  17. * Changed two digit year parsing cutoff to match strptime.
  18. * Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`.
  19. * Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`.
  20. * Removed the lang data objects from the top level namespace.
  21. * Duplicate `Date` passed to `moment()` instead of referencing it.
  22. ## [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
  23. ## [Contributing](https://github.com/moment/moment/blob/develop/CONTRIBUTING.md)
  24. We're looking for co-maintainers! If you want to become a master of time please
  25. write to [ichernev](https://github.com/ichernev).
  26. ## License
  27. Moment.js is freely distributable under the terms of the [MIT license](https://github.com/moment/moment/blob/develop/LICENSE).
  28. [license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
  29. [license-url]: LICENSE
  30. [npm-url]: https://npmjs.org/package/moment
  31. [npm-version-image]: http://img.shields.io/npm/v/moment.svg?style=flat
  32. [npm-downloads-image]: http://img.shields.io/npm/dm/moment.svg?style=flat
  33. [travis-url]: http://travis-ci.org/moment/moment
  34. [travis-image]: http://img.shields.io/travis/moment/moment/develop.svg?style=flat