# @leancodepl/api-date

> Core date and time types for API serialization

Latest version **10.6.0** (published 2026-07-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @leancodepl/api-date
pnpm add @leancodepl/api-date
yarn add @leancodepl/api-date
bun add @leancodepl/api-date
```

## Health

**Score 65/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.6.0 |
| Published | 2026-07-14 |
| First published | 2023-09-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.0.0 |
| Dependencies | 0 |
| Unpacked size | 41.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4 |
| Author | LeanCode |
| Maintainers | konowrockis, leancode-npm |
| Keywords | date, time, api, types, serialization, typescript, javascript, leancode |

## Links

- npm: https://www.npmjs.com/package/@leancodepl/api-date
- Repository: https://github.com/leancodepl/js_corelibrary
- Issues: https://github.com/leancodepl/js_corelibrary/issues
- npm.io page: https://npm.io/package/@leancodepl/api-date

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

- 10.6.0 (latest) — 2026-07-14
- 10.5.2 — 2026-07-02
- 10.5.1 — 2026-07-01
- 10.5.0 — 2026-07-01
- 10.4.0 — 2026-06-23
- 10.3.1 — 2026-05-20
- 10.3.0 — 2026-04-16
- 10.2.1 — 2026-04-13
- 10.2.0 — 2026-04-10
- 10.1.3 — 2026-04-01
- 10.1.2 — 2026-02-26
- 10.1.1 — 2026-02-23
- 10.1.0 — 2026-02-16
- 10.0.2 — 2026-02-13
- 10.0.1 — 2026-02-13
- … 65 more at https://npm.io/package/@leancodepl/api-date/versions

## README

# @leancodepl/api-date

Type definitions for API date and time handling.

## Installation

```bash
npm install @leancodepl/api-date
# or
yarn add @leancodepl/api-date
```

## API

### `ApiDateOnly`

Type representing date-only values for API communication.

### `ApiDateTime`

Type representing date and time values for API communication.

### `ApiTimeSpan`

Type representing time span values for API communication.

### `ApiTimeOnly`

Type representing time-only values for API communication.

### `ApiDateTimeOffset`

Type representing date and time with offset values for API communication.

## Usage Examples

### Type Definitions

```typescript
import { ApiDateOnly, ApiDateTime, ApiTimeSpan, ApiTimeOnly, ApiDateTimeOffset } from "@leancodepl/api-date"

interface UserProfile {
  birthDate: ApiDateOnly
  createdAt: ApiDateTime
  sessionDuration: ApiTimeSpan
  preferredTime: ApiTimeOnly
  lastLogin: ApiDateTimeOffset
}
```

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