Skip to content
Parse, validate, manipulate, and display dates in javascript.
JavaScript Other
Branch: develop
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE [misc] Update issue templates (#4661) Dec 13, 2018
benchmarks [benchmark] Load a missing locale Apr 24, 2020
dist Build 2.26.0 May 20, 2020
locale Build 2.26.0 May 20, 2020
meteor Bump version to 2.26.0 May 20, 2020
min Build 2.26.0 May 20, 2020
scripts [pkg] Include dist/ folder in npm package May 4, 2020
src [new locale] tk: Add Turkmen (#5522) May 29, 2020
tasks [pkg] Publish bundled esm under dist/ May 4, 2020
templates [misc] Build es bundle (unused for now) May 1, 2020
ts3.1-typing-tests [bugfix] update moment.d.ts for calendar (#5566) May 29, 2020
ts3.1-typings [bugfix] update moment.d.ts for calendar (#5566) May 29, 2020
typing-tests [bugfix] update moment.d.ts for calendar (#5566) May 29, 2020
.editorconfig Add .editorconfig for project May 4, 2015
.eslintrc.json Add eslint, prettier Apr 26, 2020
.gitattributes Introduce end-of-line normalization Mar 24, 2016
.gitignore added uzbek latin locale Mar 2, 2017
.npmignore Remove npmignore file from npm package Sep 1, 2016
.prettierrc Add eslint, prettier Apr 26, 2020
.spmignore ignore files in packages May 4, 2015
.travis.yml Update node versions in travis.yml Apr 23, 2020
CHANGELOG.md Update changelog for 2.26.0 May 20, 2020
CONTRIBUTING.md Create _isValid property for durations Mar 2, 2017
FAQ.md [misc] add FAQ.md (#5452) Apr 23, 2020
Gruntfile.js Remove spacejam dependency and related meteor-test Apr 28, 2020
LICENSE license typo Nov 1, 2016
Moment.js.nuspec Update changelog for 2.26.0 May 20, 2020
README.md [misc] add FAQ.md (#5452) Apr 23, 2020
bower.json remove tests when installing moment through bower Aug 7, 2017
component.json Bump version to 2.26.0 May 20, 2020
composer.json [pkg] Switch to composer-installers-extender (#5556) May 20, 2020
ender.js play nicely within an Ender build Apr 4, 2012
moment.d.ts [bugfix] Add 'w' to supported time units (#5526) May 19, 2020
moment.js Build 2.26.0 May 20, 2020
package-lock.json [pkg] Switch to composer-installers-extender (#5556) May 20, 2020
package.js add a dojo build profile Nov 26, 2012
package.json Bump version to 2.26.0 May 20, 2020

README.md

Join the chat at https://gitter.im/moment/moment

NPM version NPM downloads MIT License Build Status Coverage Status FOSSA Status SemVer compatibility

A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.

Documentation

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

  • 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

Contributing Open Source Helpers

We're looking for co-maintainers! If you want to become a master of time please write to 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.

Frequently asked questions

See FAQ.md.

License

Moment.js is freely distributable under the terms of the MIT license.

FOSSA Status

You can’t perform that action at this time.