# full-week

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

Latest version **2.0.0** (published 2021-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install full-week
pnpm add full-week
yarn add full-week
bun add full-week
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-09-22 |
| First published | 2018-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sam Hauglustaine |
| Maintainers | smhg |
| Keywords | date, week, full |

## Links

- npm: https://www.npmjs.com/package/full-week
- Repository: https://github.com/smhg/full-week
- Homepage: https://github.com/smhg/full-week#readme
- Issues: https://github.com/smhg/full-week/issues
- npm.io page: https://npm.io/package/full-week

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-09-22
- 1.3.0 — 2020-10-26
- 1.2.3 — 2020-07-17
- 1.2.2 — 2020-03-14
- 1.2.1 — 2019-10-30
- 1.2.0 — 2019-04-19
- 1.1.1 — 2018-11-23
- 1.1.0 — 2018-11-23
- 1.0.1 — 2018-11-16
- 1.0.0 — 2018-11-16

## README

# full-week [![ci](https://github.com/smhg/full-week/actions/workflows/ci.yml/badge.svg)](https://github.com/smhg/full-week/actions/workflows/ci.yml)
Calculate the start of the *n*th 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
```javascript
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
```

---
_Source: https://npm.io/package/full-week · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
