@smartput/time-range
v0.1.2
Published
`9am–5pm`, with no date on either end.
Maintainers
Readme
@smartput/time-range
9am–5pm, with no date on either end.
The clock-time range, over @smartput/time's endpoints.
Setup
npm add @smartput/time-rangeExample
import { composeLocale, createEngine } from "@smartput/core";
import { english } from "@smartput/core/locale/en";
import { BUILTIN_KINDS } from "@smartput/kinds";
import BUILTIN_EN from "@smartput/kinds/locale/en";
import { datetime } from "@smartput/datetime";
import datetimeEn from "@smartput/datetime/locale/en";
import { time } from "@smartput/time";
import { timeRange } from "@smartput/time-range";
const engine = createEngine({
locales: [composeLocale(english, [...BUILTIN_EN, datetimeEn])],
kinds: [...BUILTIN_KINDS, datetime, time, timeRange],
timeZone: "Europe/Kyiv",
});
engine.evaluate("10:00 - 20:00").formatted // "10:00 → 20:00"
engine.evaluate("9am to 5pm").formatted // "09:00 → 17:00"Entry points
| Import | Contents |
| --- | --- |
| @smartput/time-range | The package root. |
Runtime exports
Type-only exports are erased and do not appear here.
TIME_RANGE_KIND · TIME_RANGE_UNIT · createTimeRange · timeRange
Dependencies
What it costs
Ceilings, not measurements. bun run check-size bundles each entry with
bun build --minify and fails if a row crosses its ceiling or drops more
than 30 % below it — a budget that is only an upper bound reports a vanished
graph as a triumph.
| Import | Minified | Gzipped | | --- | --- | --- | | time-range | ≤ 151 kB | ≤ 52.7 kB |
Generated by scripts/gen-readmes.ts — run bun run docs:readmes. Every
output above was produced by running the line beside it. The full page, with
live demos, is docs/packages/time-range.md.
