UNPKG

datezone

Version:

A lightweight and comprehensive date and timeZone utility library for JavaScript.

107 lines 3.61 kB
import type { TimeZone } from "./timezone.pub.js"; /** * Add days. * * @param ts - The timestamp. * @param days - The number of days to add. * @param timeZone - The timezone. * @returns The new timestamp. * @see https://datezone.dev/docs/reference/day#adddays */ export declare function addDays(ts: number, days: number, timeZone: TimeZone | null): number; /** * Subtract days. * * @param ts - The timestamp. * @param days - The number of days to subtract. * @param timeZone - The timezone. * @returns The new timestamp. * @see https://datezone.dev/docs/reference/day#subdays */ export declare function subDays(ts: number, days: number, timeZone: TimeZone | null): number; /** * Start of day. * * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The timestamp for the start of the day. * @see https://datezone.dev/docs/reference/day#startofday */ export declare function startOfDay(ts: number, timeZone: TimeZone | null): number; /** * End of day. * * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The timestamp for the end of the day. * @see https://datezone.dev/docs/reference/day#endofday */ export declare function endOfDay(ts: number, timeZone: TimeZone | null): number; /** * Day of month. * * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The day of the month. * @see https://datezone.dev/docs/reference/day#dayofmonth */ export declare function dayOfMonth(ts: number, timeZone: TimeZone | null): number; /** * Get day of week using Javascript Standard 0 = Sunday, 6 = Saturday * * @deprecated Use {@link dayOfWeek} instead that follows ISO standard. * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The JavaScript day of the week (0=Sunday, 6=Saturday). * @see https://datezone.dev/docs/reference/day#getday */ export declare function getDay(ts: number, timeZone: TimeZone | null): number; /** * Day of week. * * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The ISO day of the week. * @see https://datezone.dev/docs/reference/day#dayofweek */ export declare function dayOfWeek(ts: number, timeZone: TimeZone | null): number; /** * Day of week base. * * @param year - The year. * @param month - The month (1-12). * @param day - The day (1-31). * @returns The ISO day of the week. * @see https://datezone.dev/docs/reference/day#dayofweekbase */ export declare function dayOfWeekBase(year: number, month: number, day: number): number; /** * Day of year. * * @param ts - The timestamp. * @param timeZone - The timezone. * @returns The day of the year. * @see https://datezone.dev/docs/reference/day#dayofyear */ export declare function dayOfYear(ts: number, timeZone: TimeZone | null): number; export declare function dayOfYearBase(year: number, month: number, day: number): number; /** * Week day name. * * @param locale - The locale string. * @param type - The format of the name ("long", "short", or "narrow"). * @param day - The ISO day of the week (1=Monday, 7=Sunday). * @returns The localized weekday name. * @see https://datezone.dev/docs/reference/day#weekdayname */ export declare function weekDayName(locale: string, type: "long" | "short" | "narrow", day: number): string; /** * Get day period. * * @param locale The locale string. * @param hour The hour (0-23). * @returns The localized day period string. * @see https://datezone.dev/docs/reference/day#getdayperiod */ export declare function getDayPeriod(locale: string, hour: number): string; //# sourceMappingURL=day.pub.d.ts.map