streak-cal-core
v1.0.0
Published
Dependency-free calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for svelte-streak-cal.
Readme
streak-cal-core
Dependency-free calendar-day and streak-math primitives. This is the helper
package behind svelte-streak-cal; it is not meant to
be imported directly from application code.
API
import { dayKey, addDays, dayDiff, bucketByDay, qualifyingDayKeys } from 'streak-cal-core';
import { store } from 'streak-cal-core/store'; // Node-onlydayKey(date, timeZone?)→"YYYY-MM-DD"addDays(key, n)→ shifted day keydayDiff(aKey, bKey)→ whole-day differencebucketByDay(entries, timeZone?)→Map<dayKey, total>qualifyingDayKeys(entries, goal, timeZone?)→ sorted day keys meeting the goal
