UNPKG

streak-calc-math

Version:

Dependency-free calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for streak-calc-math.

14 lines (11 loc) 585 B
export interface DayEntry { date: string | number | Date; value: number; } export function dayKey(date: string | number | Date, timeZone?: string): string; export function addDays(key: string, n: number): string; export function dayDiff(aKey: string, bKey: string): number; export function bucketByDay(entries: DayEntry[], timeZone?: string): Map<string, number>; export function qualifyingDayKeys(entries: DayEntry[], goal: number, timeZone?: string): string[]; /** Epoch ms when this module was first evaluated (import-time startup self-check). */ export const bootedAt: number;