@gobrand/tiempo 2.3.4 → 2.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -25
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -18,31 +18,39 @@ yarn add @gobrand/tiempo
18
18
 
19
19
  ## Why tiempo?
20
20
 
21
- The Temporal API is powerful but requires understanding its various methods and objects. **tiempo** (`@gobrand/tiempo`) provides intuitive utilities for every datetime task:
22
-
23
- - **🌍 Timezone conversions** - Convert between UTC and any timezone effortlessly
24
- - **➕ Complete arithmetic** - Add/subtract any time unit from nanoseconds to years
25
- - **📅 Calendar operations** - Start/end of day, week, month, year with DST handling
26
- - **🔍 Comparisons** - Check if dates are before, after, same day, future, or past
27
- - **📊 Differences** - Calculate precise differences in any time unit
28
- - **🎨 Formatting** - Format dates with date-fns-style tokens or Intl
29
- - **⚡️ Type-safe** - Full TypeScript support with proper Temporal types
30
- - **🎯 Zero config** - Simple, direct function signatures
31
-
32
- **Key features:**
33
- - Native timezone support with Temporal API
34
- - DST transitions handled automatically
35
- - ✅ Nanosecond precision (beyond milliseconds)
36
- - ✅ Calendar-aware arithmetic (leap years, month-end dates)
37
- - ✅ Familiar date-fns-style API, built for the future
38
-
39
- **Perfect for:**
40
- - Social media scheduling apps
41
- - Calendar applications
42
- - Booking systems
43
- - Time tracking tools
44
- - Analytics dashboards
45
- - Any app that needs to handle user timezones
21
+ JavaScript's `Date` object was modeled after a Java class that was deprecated over 25 years ago. It conflates timestamps with calendar dates, only works in UTC or device-local time, and its mutating methods cause countless bugs. The [Temporal API](https://tc39.es/proposal-temporal/docs/) is the modern replacement, designed from the ground up to fix these problems.
22
+
23
+ **tiempo** makes Temporal accessible with an intuitive, date-fns-style API:
24
+
25
+ ### The Temporal Advantage
26
+
27
+ | Problem with `Date` | Temporal Solution | tiempo API |
28
+ |---------------------|-------------------|------------|
29
+ | Only UTC or local time | Any IANA timezone | `toZonedTime(date, "America/New_York")` |
30
+ | Millisecond precision | Nanosecond precision | `addNanoseconds()`, `differenceInNanoseconds()` |
31
+ | Mutating methods | Immutable operations | All functions return new values |
32
+ | Ambiguous representations | Distinct types for each use case | `Instant`, `ZonedDateTime`, `PlainDate` |
33
+ | DST bugs everywhere | DST-aware arithmetic | `addDays()` respects timezone rules |
34
+ | Gregorian calendar only | Multi-calendar support | Works with Hebrew, Chinese, Japanese, and more |
35
+
36
+ ### Features
37
+
38
+ - **First-class timezone support** - Convert, compare, and calculate across any of 400+ IANA timezones with confidence
39
+ - **Nanosecond precision** - Beyond milliseconds for scientific computing, financial systems, and high-frequency operations
40
+ - **DST-safe arithmetic** - Adding days means calendar days, not 24-hour periods that break at clock changes
41
+ - **Immutable by design** - No mutations, no side effects, no surprises
42
+ - **Type-safe** - Full TypeScript support catches datetime errors at compile time
43
+ - **Familiar API** - date-fns-style functions built on modern foundations
44
+ - **Zero dependencies** - Only the Temporal polyfill for browser compatibility
45
+
46
+ ### Perfect for
47
+
48
+ - **Scheduling apps** - Social media, meetings, reminders with proper timezone handling
49
+ - **Booking systems** - Hotels, flights, events across global timezones
50
+ - **Calendar applications** - Date math that respects DST and leap years
51
+ - **Time tracking** - Precise duration calculations with nanosecond accuracy
52
+ - **Analytics dashboards** - Aggregate by day/week/month in user timezones
53
+ - **Global applications** - Any app serving users across multiple timezones
46
54
 
47
55
  ## Quick Start
48
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobrand/tiempo",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "Lightweight utility functions for converting between UTC and timezone-aware datetimes using the Temporal API",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -28,7 +28,7 @@
28
28
  "bugs": {
29
29
  "url": "https://github.com/go-brand/tiempo/issues"
30
30
  },
31
- "homepage": "https://github.com/go-brand/tiempo#readme",
31
+ "homepage": "https://eng.gobrand.app/tiempo",
32
32
  "scripts": {
33
33
  "build": "tsup && tsc --emitDeclarationOnly",
34
34
  "clean": "git clean -xdf .cache .turbo dist node_modules tsconfig.tsbuildinfo",