week_no

0.0.2 • Public • Published

weekNo

Build Status

Calculate the week number for a given date

This module extends the Date.prototype, I know don't do this, whatever. If you need week numbers I think it's clean this way.

By default weeks are numberd based on 1970-1-5 (the first monday of 1970, as this presents the first week.

example

require('week_no');
new Date(1971, 0, 5).weekNo() # => 52
new Date(1972, 0, 5).weekNo() # => 104

methods

require('week_no')

new Date(1970, 0, 5).weekNo()

Return a the number of weeks since 1970-1-5.

new Date(1970, 0, 5).weekNoRelative()

Return a the number of weeks since 1970-1-5 modulo 52.

install

With npm do:

npm install week_no

license

BSD

Readme

Keywords

none

Package Sidebar

Install

npm i week_no

Weekly Downloads

0

Version

0.0.2

License

BSD

Last publish

Collaborators

  • sideshowcoder