JS Date Format & validate Library - Moment.js

JS Date Format & validate Library - Moment.js
File Size: 1.94 MB
Views Total: 10746
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Moment.js is a lightweight and robust JavaScript date library that allows you to parse, validate, manipulate, and format dates & times.

Extensions:

Alternatives:

  • dayjs: 2KB immutable date library alternative to Moment.js

Installation:

# NPM
$ npm install moment --save

Basic usage:

1. Import the Moment.js library.

// Webpack
var moment = require('moment');

// Typescript
import * as moment from 'moment';
<!-- From A CDN -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script>
<!-- With Locals -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/min/moment-with-locales.min.js"></script>

2. Read the documentation for API.

Changelog:

v2.26.0 (2020-05-29)

  • Update

This awesome jQuery plugin is developed by timrwood. For more Advanced Usages, please check the demo page or visit the official website.