# next_monday

> Allows you to find the nearest day of the week. For example, the nearest saturday. Or next monday. Or the previous thursday.

Latest version **1.0.0** (published 2018-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install next_monday
pnpm add next_monday
yarn add next_monday
bun add next_monday
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-11-17 |
| First published | 2018-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leonardo Bighi |
| Maintainers | bighi |
| Keywords | date, monday, time, week |

## Links

- npm: https://www.npmjs.com/package/next_monday
- Repository: https://github.com/bighi/next_monday
- Homepage: https://github.com/bighi/next_monday#readme
- Issues: https://github.com/bighi/next_monday/issues
- npm.io page: https://npm.io/package/next_monday

## 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

- 1.0.0 (latest) — 2018-11-17

## README

# Next monday

This is a simple package to help you find a date by the day of the week.

Want to find the nearest Friday? Next Monday? Previous Thursday? Just ask!

This is licensed under the MIT License. Check [the License](./LICENSE) for further details.

## How to Install

Just install it from npm.

`npm install next_monday --save`

## How to Use

First add it to your script with:

`const nm = require('next_monday')`

Then you can use any of its methods to find the day of the week you want.

They expect ONE argument: the day of the week. It can be the **name** of the day (like "Saturday" or "saturday"), or the **number** of the day like JavaScript does (0 is Sunday, 1 is Monday, etc).

There's a short version for all those methods, if you dislike longer method names.

**All of those methods will return a Date object.**

### Finding the nearest day of week

This method will return the **nearest** day of the week. It may be **before** or **after** today.

`date = nm.findNearestDayOfWeek('friday')`

or

`date = nm.nearest('friday')`

### Finding the next day of the week

This method will return the nearest desired day AFTER today. You use this when you want a guarantee that the day is in the future.

`date = nm.findNextDayOfWeek('Monday')`

or

`date = nm.next('monday')`

### Finding the previous day of the week

This method will return the nearest desired day BEFORE today. You use this when you want a guarantee that the day is in the past.

`date = nm.findPreviousDayOfWeek('thursday')`

or

`date = nm.previous('Friday')`

## That's it

Yes, that's it. Just a small and simple library.

# Author

This was created by Leonardo Bighi.

You can find me on [twitter](www.twitter.com/bighi).

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