moment-weekofmonth
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

moment-weekofmonth

moment-weekofmonth-CI version install size downloads

Gets the week of the month.
Use the moment object to find the week number of the month.

Installation

Install via NPM:

npm install moment moment-weekofmonth

Usage

Javascript

var moment = require("moment");
var wom = require("moment-weekofmonth");
var nowDate = moment(); // 2020-02-29
 
wom(moment('2020-01-01')); // 1
wom(nowDate); // 5
wom(); // TypeError: Cannot read property 'week' of undefined

TypeScript

import * as moment from "moment";
import * as wom from "moment-weekofmonth";
 
const nowDate = moment(); // 2020-02-29
 
wom(moment('2020-01-01')); // 1
wom(nowDate); // 5
wom(); // TypeError: Cannot read property 'week' of undefined```

Package Sidebar

Install

npm i moment-weekofmonth

Weekly Downloads

23

Version

1.0.1

License

MIT

Unpacked Size

5.87 kB

Total Files

7

Last publish

Collaborators

  • swtpumpkin