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

full-week

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

full-week

Calculate the start of the nth full week of a year or month.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

full-week ci

Calculate the start of the nth full week of a year or month.

API

fullWeek(index, year)

Calculate the start of the nth week of a year

fullWeek(index, year, month = 0)

Calculate the start of the nth week of a month

fullWeek(index, year, month = 0, startOfWeek = 1)

Calculate the start of the nth week of a month defining on what day weeks start

Note: month and startOfWeek parameters use JavaScript's indexing approach (January = 0, first day of the week = 0)

Usage

import fullWeek from 'full-week';

// start of first full week of 2021
fullWeek(1, 2021); // 2021-01-04T00:00:00

// start of 3rd full week of November 2018
fullWeek(3, 2018, 10); // 2018-11-19T00:00:00

const firstFullWeek = (year, month) => fullWeek(1, year, month);

// start of first full week of November 2018
firstFullWeek(2018, 10); // 2018-11-05T00:00:00
// start of first full week of 2019
firstFullWeek(2019); // 2019-01-07T00:00:00

// start of last full week of April 2019
fullWeek(-1, 2019, 4); // 2019-04-22T00:00:00

Keywords

FAQs

Package last updated on 22 Sep 2021

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