cedmax / prev-day

Get the previous day in the week, eg: last Thursday

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prev-day

Get the previous occurance of a day of the week, eg: last Thursday

Build Status npm version Dependency status codecov

Installation

npm install --save prev-day

Usage

var prevDay = require('prev-day');
// get previous Monday
prevDay(new Date(), 1); // returns { date: [Date] , daySince: 4 }
                                            ^ date object    ^ day passed since prev Monday

// or equivalent to
prevDay(new Date(), prevDay.Monday);

About

Get the previous day in the week, eg: last Thursday

License:MIT License


Languages

Language:JavaScript 100.0%