current-week-number
Get current week number of the current year or given date string format.
Last updated 6 years ago by tunnckocore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install current-week-number 
SYNC missed versions from official npm registry.

npm mit license build status coverage status deps status

Get current week number of the current year,given Date format string or Date object.

Install

npm i --save current-week-number
npm test
current-week-number --help

API

For more use-cases see the tests

currentWeekNumber

Get week number of the current date/year or given valid Date string format

  • [date] {String} every valid Date-ish string format
  • return {Number}

Example:

var currentWeekNumber = require('current-week-number');

// june 27, 2014
currentWeekNumber();
//=> 26

currentWeekNumber('March 24, 2015');
//=> 13

currentWeekNumber(new Date('March 24, 2015'));
//=> 13

currentWeekNumber('03/24/2016');
//=> 12, cuz' year is leap

currentWeekNumber('August 07, 2015');
//=> 32

currentWeekNumber(new Date('August 07, 2016'));
//=> 31

currentWeekNumber('02/16/2015');
//=> 8

currentWeekNumber('September 15, 2126');
//=> 37

currentWeekNumber('02/17/2012');
//=> 7

CLI

You can just run current-week-number --help for more information

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Released under the MIT license.


Powered and automated by kdf, March 02, 2015

Current Tags

  • 1.0.7                                ...           latest (5 years ago)

9 Versions

  • 1.0.7                                ...           5 years ago
  • 1.0.6                                ...           6 years ago
  • 1.0.5                                ...           6 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Downloads
Today 0
This Week 2
This Month 4
Last Day 0
Last Week 5
Last Month 36
Dependencies (1)
Dev Dependencies (8)

Copyright 2014 - 2017 © taobao.org |