Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

week_no

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

week_no

get the week number for a date

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 16 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc