# datetime-types

> Types for representing date, times, intervals and durations

Latest version **0.3.0** (published 2019-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install datetime-types
pnpm add datetime-types
yarn add datetime-types
bun add datetime-types
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2019-10-04 |
| First published | 2019-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 108.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | aholstenson |

## Links

- npm: https://www.npmjs.com/package/datetime-types
- Repository: https://github.com/aholstenson/datetime-types
- Homepage: https://github.com/aholstenson/datetime-types#readme
- Issues: https://github.com/aholstenson/datetime-types/issues
- npm.io page: https://npm.io/package/datetime-types

## Dependencies (1)

- [date-fns](https://npm.io/package/date-fns.md) ^2.4.1

## Recent versions

- 0.3.0 (latest) — 2019-10-04
- 0.2.0 — 2019-10-04
- 0.1.0 — 2019-10-04

## README

# datetime-types

This library provides immutable dates, times, intervals, periods and durations
for JavaScript and TypeScript. These types help carry the intent of a value,
instead of representing everything as a `Date`.

```javascript
import { LocalDate, LocalTime } from 'datetime-types';

const date = LocalDate.of(2042, 10, 2);
const time = LocalTime.from({
  hour: 12,
  minute: 45
});
```

## Status and features

This is currently an early release with only a few types without much ability
to manipulate values.

Types implemented:

* `LocalDate` for representing a date without a time
* `LocalTime` for representing a time without a date or timezone
* `LocalDateTime` for representing a date and time without a timezone
* `DayOfWeek` enumeration
* `Month` enumeration
* `Year` for representing a single year
* `DateInterval` for representing an interval between two dates

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