@radarwave/next-update
v1.0.0
Published
A package for calculating the next SPC outlook update times.
Readme
next-update
Installation
npm install @radarwave/next-updateUsage:
import { nextUpdates, nextUpdate, lastUpdate, secondsToNext } from '@radarwave/next-update';
const dfor = new Date();
// Get all upcoming update times grouped by day
const updates: Record<number, Date[]> = nextUpdates(dfor);
// Get the next upcoming update date or null if none
const next: Date | null = nextUpdate(dfor);
// Get the most recent past update date or null if none
const last: Date | null = lastUpdate(dfor);
// Get seconds until the next update or null if none
const seconds: number | null = secondsToNext(dfor);
