Comparing version 2.0.29 to 2.0.30
@@ -26,2 +26,5 @@ import { DateSpan } from "./DateSpan"; | ||
function getWeekDay(date: Date): number; | ||
function getWeekDay(date: Date, locale: Locale, options?: { | ||
format?: "long" | "short" | "narrow"; | ||
}): string; | ||
function nextWeekday(date: Date, days?: number | DateSpan, holidays?: Date[]): Date; | ||
@@ -28,0 +31,0 @@ function span(date: Date, relative: Date): DateSpan; |
@@ -150,4 +150,8 @@ "use strict"; | ||
Date.getDay = getDay; | ||
function getWeekDay(date) { | ||
return new globalThis.Date(date).getDay(); | ||
function getWeekDay(date, locale, options) { | ||
var _a; | ||
const format = (_a = options === null || options === void 0 ? void 0 : options.format) !== null && _a !== void 0 ? _a : "long"; | ||
return locale | ||
? new globalThis.Date(date).toLocaleDateString(locale, { weekday: format }) | ||
: new globalThis.Date(date).getDay(); | ||
} | ||
@@ -154,0 +158,0 @@ Date.getWeekDay = getWeekDay; |
@@ -26,2 +26,5 @@ import { DateSpan } from "./DateSpan"; | ||
function getWeekDay(date: Date): number; | ||
function getWeekDay(date: Date, locale: Locale, options?: { | ||
format?: "long" | "short" | "narrow"; | ||
}): string; | ||
function nextWeekday(date: Date, days?: number | DateSpan, holidays?: Date[]): Date; | ||
@@ -28,0 +31,0 @@ function span(date: Date, relative: Date): DateSpan; |
@@ -147,4 +147,7 @@ export var Date; | ||
Date.getDay = getDay; | ||
function getWeekDay(date) { | ||
return new globalThis.Date(date).getDay(); | ||
function getWeekDay(date, locale, options) { | ||
const format = options?.format ?? "long"; | ||
return locale | ||
? new globalThis.Date(date).toLocaleDateString(locale, { weekday: format }) | ||
: new globalThis.Date(date).getDay(); | ||
} | ||
@@ -151,0 +154,0 @@ Date.getWeekDay = getWeekDay; |
{ | ||
"name": "isoly", | ||
"version": "2.0.29", | ||
"version": "2.0.30", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "Utily Contributors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1848982
38250