Skip to content

sergeymelkumyan/norepeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

datesformatter

This is a Moment.js plugin that allows you to work with start and end dates without repetition, for example "mar 1 - 12"

Note

  • This plugin works on both server and client side.

Usage

// NodeJS: require instead of standard moment package
var moment = require('norepeatdate');
// You'll be able use Moment.js as you normally do

API

The objects returned by methods are Moment.js objects (except norepeatdate) so you can handle them with Moment.js native methods.

.norepeatdate(date1, date2, 'lang');

var date = moment().norepeatdate(new Date(2020, 0), new Date(2020, 1), 'en');
// Jan 01 - Feb 01, 2020

Installation

// For Node.js
$ npm install moment
$ npm install norepeatdate

// ...or install and save in package.json
$ npm install --save moment
$ npm install --save norepeatdate

// For bower
$ bower install moment
$ bower install norepeatdate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published