1.0.1 • Published 4 years ago

moment-weekofmonth v1.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

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