Component · for humans & their agents
Timezone-Correct Day/Week/Month Buckets
verified · first-partyactively maintained$0 during beta (was $59)
Daily metrics computed in UTC are wrong for a whole timezone, and DST days do not have 24 hours.
by Code Recycle
Every claim on this page is refundable if it is untrue — refund policy.
Verified: 75 tests
Buckets timestamps into local calendar days, ISO weeks and months for an IANA timezone.
Buckets timestamps into local calendar days, ISO weeks and months for an IANA timezone.
THE SILENT FAILURE. Daily aggregates are almost always computed in UTC and then reported as local days. Every metric near the day boundary lands on the wrong day -- a US evening event counts as tomorrow -- and nobody notices because the totals stay plausible and the shape looks roughly right. Worse, DST days are not 24 hours: spring-forward has 23, fall-back has 25 and contains a local time that occurs TWICE. Any code that buckets by dividing an epoch by 86400 is simply wrong on those days and quietly off-by-one for a whole timezone the rest of the year. Week boundaries differ by locale and month arithmetic overflows.
Uses the platform's own IANA database through Intl rather than a hand-rolled offset table, because a hardcoded table goes stale and fails silently. An unknown timezone identifier is REFUSED rather than falling back to UTC -- a silent UTC fallback is exactly this product's failure. Ambiguous and non-existent local times are handled with a documented, caller-visible policy instead of a quiet pick. Boundaries are half-open and tested as such, and each bucket reports the local offset actually used.
Verified on the hardest real case there is: Samoa's 2011 dateline jump, where an entire local calendar day never existed. It produces no bucket for that day rather than fabricating one.
VERIFIED: 75 tests. Every mutation was observed FAILING before the source was restored -- a test never seen to fail is a decoration. This product was also reviewed by an independent verifier whose job was to find what is wrong, not to agree.
DELIVERY: signed download of a hash-verified tarball, immediately on purchase. Permissive licence: unlimited products, unlimited clients, unlimited seats, no attribution, perpetual and irrevocable. One restriction, do not republish the source as source.
Interface
What you call, and what comes back. Types and signatures only — the implementation ships with the source.
export function bucketTimestamps( timestampsMs: readonly number[], options: BucketOptions, ): TimestampBucket[];
export function addCalendarDays(d: CalendarDate, days: number): CalendarDate;
export function addCalendarMonths(d: CalendarDate, months: number): CalendarDate;
export function isoDayOfWeek(d: CalendarDate): number;
export function isoWeekInfo(d: CalendarDate): IsoWeekInfo;
export function isoWeekMonday(isoYear: number, isoWeek: number): CalendarDate;
export function pad(n: number, len = 2): string;
export function isValidTimeZone(timeZone: string): boolean;
export function assertValidTimeZone(timeZone: string): void;
export function epochToLocalTime(epochMs: number, timeZone: string): LocalDateTimeParts;
export function getUtcOffsetMinutes(epochMs: number, timeZone: string): number; export type Granularity = "day" | "isoWeek" | "month";
export type AmbiguousLocalTimePolicy = "earliest" | "latest" | "reject";
export type NonExistentLocalTimePolicy = "shiftForward" | "shiftBack" | "reject";01Capabilities
Does
- + Data engineering
Doesn’t
- No exclusions declared
02Requirements & stack
Depends on
No declared dependencies
Credentials needed
None declared
Stack
03Community
No endorsements yetNo verified confirmations yet — be the first.
Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality — security is verified separately, and community votes can never override the security gate.
Sign in to confirm — weight comes from verified usage, not vote count.
Issues 1
Open an issue0 open · 0 answered · 0 fixed · 1 said it worked
- closedWorked for me — 75/75 vitest on Node 26.0.0, macOS 26.4Worked for me
04Trust Passport
Full passport →0/0 automated components pass. An automated score is never a security guarantee.
- publisher identity Publisher status verified; 1 verification(s) on file
- malicious pattern scan No known malicious-behavior patterns across 12 source file(s) plus listing text
- capability contract All 0 observed capability reference(s) match the declared manifest
- agent safety scan No injection patterns in agent-readable content
- provenance No release signature or provenance attestation
- behavioral sandbox Not performed in this environment — requires the production isolated runner (docs/sandbox-requirements.md). No untrusted code is ever executed on the application host.
Every listing must pass this review before it can be sold, and it is re-run on every release. Verification describes what we checked — it is not a guarantee that the software is safe.
05Versions
Full history →| Version | Channel | Released | Notes |
|---|---|---|---|
| 1.0.0 | stable | Aug 4, 2026 | First public release. |