cmw

current-month-week-number

Get the current month week number

Showing:

Popularity

Downloads/wk

0

GitHub Stars

1

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

1

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

current-month-week-number

Simple function to get the current month's week number for a given day in that month.

Motivation

The main reason I created this package was as a result of wanting to do something that I thought was easy but after spending hours without getting it right and a lot of suggested solutions on stack overflow not achieving what I wanted. I vowed that once I get it working I'll publish the solution for someone to use it if they ever have similar requirement that I had. So this is me fulfilling my vow :); I hope someone will find this useful. Thanks to Cornelous and Tinashe for their valuable input.

Build Status | Test Coverage

Installation

npm install current-month-week-number --save

Usage

var weekNumber = require('current-month-week-number');
var weekNumberIs = weekNumber.weekNumberOfCurrentMonth(11); // 11th of the current month
var weekNumberForGivenDate = weekNumber.weekNumberForGivenDate('2017', '1', '17');// i.e January 17th 2017
Note: month must be between 1-12 and date between 1-31 and year must be full year including century like 2010 or 1999

Tests

npm install
npm test
npm run coverage

Dependencies

  • moment: Parse, validate, manipulate, and display dates

Dev Dependencies

  • jest Delightful JavaScript Testing

None

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial