https://github.com/ver0-project/now-ish
Parse relative time expressions like now-7d or now/w – user-friendly syntax for dashboards and analytics. Grafana-compatible, fully extensible with custom units and localization. Adapters for date-fns and Temporal API.
https://github.com/ver0-project/now-ish
date-fns date-range grafana relative-time temporal time-parser typescript
Last synced: 11 days ago
JSON representation
Parse relative time expressions like now-7d or now/w – user-friendly syntax for dashboards and analytics. Grafana-compatible, fully extensible with custom units and localization. Adapters for date-fns and Temporal API.
- Host: GitHub
- URL: https://github.com/ver0-project/now-ish
- Owner: ver0-project
- License: mit
- Created: 2026-01-27T17:43:51.000Z (17 days ago)
- Default Branch: master
- Last Pushed: 2026-01-30T14:45:35.000Z (14 days ago)
- Last Synced: 2026-01-31T04:15:54.589Z (13 days ago)
- Topics: date-fns, date-range, grafana, relative-time, temporal, time-parser, typescript
- Language: TypeScript
- Homepage:
- Size: 225 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
now-ish
Parse relative time expressions like now-7d or now/w
## Quick Start
Pick the adapter for your date library:
```bash
# date-fns users
npm install @ver0/now-ish_date-fns @ver0/now-ish
# Temporal API users
npm install @ver0/now-ish_temporal @ver0/now-ish
```
```typescript
import {parse} from '@ver0/now-ish_date-fns';
const sevenDaysAgo = parse('now-7d');
const startOfToday = parse('now/d');
const endOfMonth = parse('now/mo', 'round-up');
```
## Packages
| Package | Description |
|---------|-------------|
| [@ver0/now-ish](./packages/now-ish) | Core parser — expression syntax, extensibility, types |
| [@ver0/now-ish_date-fns](./packages/now-ish_date-fns) | date-fns adapter — returns `TZDate` |
| [@ver0/now-ish_temporal](./packages/now-ish_temporal) | Temporal API adapter — returns `ZonedDateTime` |
## Expression Syntax
```
now[/round][±Nunit[/round]]
```
- `now-7d` → 7 days ago
- `now/d` → start of today
- `now-7d/d` → start of day, 7 days ago
- `now/mo+1mo/mo` → start of next month
See the [core package](./packages/now-ish) for the complete syntax guide.
## License
[MIT](./LICENSE)