# good-date

> A Javascript date class that makes sense

Latest version **1.3.16** (published 2020-01-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install good-date
pnpm add good-date
yarn add good-date
bun add good-date
```

## 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.3.16 |
| Published | 2020-01-13 |
| First published | 2019-10-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | jeff.hykin |

## Links

- npm: https://www.npmjs.com/package/good-date
- Repository: https://github.com/jeff-hykin/good-date
- Homepage: https://github.com/jeff-hykin/good-date#readme
- Issues: https://github.com/jeff-hykin/good-date/issues
- npm.io page: https://npm.io/package/good-date

## Recent versions

- 1.3.16 (latest) — 2020-01-13
- 1.3.15 — 2020-01-13
- 1.3.14 — 2020-01-13
- 1.3.13 — 2020-01-13
- 1.3.12 — 2020-01-13
- 1.3.11 — 2020-01-13
- 1.3.10 — 2019-12-04
- 1.3.7 — 2019-11-25
- 1.3.6 — 2019-11-25
- 1.3.3 — 2019-11-24
- 1.3.2 — 2019-11-24
- 1.3.1 — 2019-11-24
- 1.3.0 — 2019-11-24
- 1.2.2 — 2019-11-23
- 1.2.1 — 2019-11-23
- … 4 more at https://npm.io/package/good-date/versions

## README

## Good Date

A Javascript date class that actually makes sense

```javascript
let DateTime = require('good-date')

// a valid date with no time
let aDate = new DateTime('12/31/1999')
let aDate = new DateTime('1999-12-31')
let aDate = new DateTime('1999-12-31T00:00:00')

aDate.day       // 31
aDate.month     // 12
aDate.year      // 1999
aDate.date      // 12/31/1999

// easy time set/get
aDate.time = '1:30pm'
aDate.time = '1:30:20pm'
aDate.time = '1:30:20.5'
aDate.time = '1:30:20.5am'
aDate.seconds // 20.5
aDate.minute  // 30
aDate.amPm    // pm
aDate.hour12  // 1
aDate.hour24  // 13

// helpers
aDate.monthName // December
aDate.dayName   // Friday
aDate.weekIndex // 5
aDate.unix      // milliseconds since the unix epoch

// an invalid date throw errors instead of failing silently
let aDate = new DateTime('Blah')
```

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