Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.32 KB

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```