Socket
Socket
Sign inDemoInstall

date-manip

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-manip

A modern JavaScript Date utility library delivering modularity, performance, & extras.


Version published
Weekly downloads
1.1K
increased by40.16%
Maintainers
1
Weekly downloads
 
Created
Source

date-manip

npm package

Note: A modern JavaScript Date utility library delivering modularity, performance, & extras.

NPM version NPM Downloads


Installation

Load date-manip via classical <script> tag

<script src="https://cdn.jsdelivr.net/npm/date-manip/date-manip.umd.min.js"></script>
<script>
  // window.dateManip
  dateManip.add
  dateManip.format
  // ...
</script>

<script src="https://cdn.jsdelivr.net/npm/date-manip/date-chain.umd.min.js"></script>
<script>
  // window.DateChain
  DateChain.add
  DateChain.format
  // ...

  var now = new DateChain(); // DateChain();
  now.add
  now.format
  // ...
</script>

CommonJS style with npm

npm install date-manip --save

// es6
import { 
  add, 
  format, 
  // ...
} from 'date-manip';
// or
import { ... } from 'date-manip/es';

// modularity
import add from 'date-manip/add';
import format from 'date-manip/format';

// date-chain
import moment from 'date-manip/date-chain';

moment('2000-2-29')
  .add({
    year: 1,
    month: 1,
    day: 1,
    hour: 1,
    minute: 1,
    second: 1,
    millisecond: 1
  })
  .add(1, 'month')
  .startOf('date')
  .format('YYYY-MM-DD');

API

  • add
  • addDays
  • addHours
  • addMilliseconds
  • addMinutes
  • addMonths
  • addSeconds
  • addYears
  • clone
  • dayOfYear
  • daysInMonth
  • diff
  • endOf
  • format
  • get
  • isAfter
  • isBefore
  • isBetween
  • isLeapYear
  • isSame
  • isSameOrAfter
  • isSameOrBefore
  • isValid
  • parse
  • set
  • startOf
  • subtract

Keywords

FAQs

Package last updated on 07 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc