# ir-time-converter

> Converts js date to iRacing time and the other way around.

Latest version **1.1.1** (published 2021-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ir-time-converter
pnpm add ir-time-converter
yarn add ir-time-converter
bun add ir-time-converter
```

## 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.1.1 |
| Published | 2021-08-16 |
| First published | 2021-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Karl-Heinz Wallwitz |
| Maintainers | 0xkalle |
| Keywords | iRacing, season, week, date, time |

## Links

- npm: https://www.npmjs.com/package/ir-time-converter
- Repository: https://github.com/kuhldata/ir-time-converter
- Homepage: https://github.com/kuhldata/ir-time-converter#readme
- Issues: https://github.com/kuhldata/ir-time-converter/issues
- npm.io page: https://npm.io/package/ir-time-converter

## 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.1.1 (latest) — 2021-08-16
- 1.1.0 — 2021-08-13
- 1.0.0 — 2021-08-13

## README

# ir-time-converter

Small package translating JS Date objects to iRacing Season / Week / Day and the other way around.

## install

`npm i ir-time-converter`

## examples
Get iRacing Time for a specific Date object.
```js
const timeConverter = require('ir-time-converter');

const iRacingTime = timeConverter.dateToIRacingTime(new Date());
// {
//   year: 2021,
//   season: 3,
//   week: 9,
//   day: 6,
//   isLeapSeason: false,
//   isWeek13: false,
// }
```

Get time frame for a specific iRacing Time. (Example for season but it is possible down to a specific day)
```js
const timeConverter = require('ir-time-converter');

const timeFrame = timeConverter.iRacingSeasonToDates(2021, 3);
// {
//   start: [Object], JS Date representing the first second of the season
//   end: [Object] JS Date representing the last second of the season
// }
```

## docs

See `DOCS.md` :).

## Support
If you want to support me, I am happy to welcome you to the [kuhldata Discord](https://discord.gg/PTuZfQRWDj).

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