1.0.0 • Published 1 year ago

@migpalg/currweek v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@migpalg/currweek

Build Status

Returns the current week number

🚀 Getting started

Install the package with your favorite package manager:

pnpm add @migpalg/currweek
# with yarn: yarn add @migpalg/currweek
# with npm: npm install @migpalg/currweek

💡 Usage

The simplest way to use this package is importing it and using it directly:

import { getWeekNumber } from '@migpalg/currweek';

const currentWeekNumber = getWeekNumber(); // Returns current week number

Get week number from a specific date

Pass the target date as parameter:

import { getWeekNumber } from '@migpalg/currweek';

const targetWeekNumber = getWeekNumber(new Date(2021, 10, 10));

Also you can pass a date string or a unix timestamp as parameter:

import { getWeekNumber } from '@migpalg/currweek';

const targetWeekNumber = getWeekNumber('2021-11-16T22:51:37.949Z');
const anotherWeekNumber = getWeekNumber(1637103125359);
1.0.0

1 year ago

0.6.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago