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.
require('week_no');
new Date(1971, 0, 5).weekNo() # => 52
new Date(1972, 0, 5).weekNo() # => 104
require('week_no')
Return a the number of weeks since 1970-1-5
.
Return a the number of weeks since 1970-1-5
modulo 52.
With npm do:
npm install week_no
BSD