@zag-js/date-utils 0.0.0-dev-20230605160807 → 0.0.0-dev-20230605180544
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertion.d.ts +1 -1
- package/dist/constrain.d.ts +1 -1
- package/dist/format-date.d.ts +1 -1
- package/dist/format-selected-date.d.ts +1 -1
- package/dist/format-visible-range.d.ts +1 -1
- package/dist/get-month-days.d.ts +1 -1
- package/dist/get-start-of-week.d.ts +1 -1
- package/dist/get-weekday-formats.d.ts +1 -1
- package/dist/mutation.d.ts +1 -1
- package/dist/pagination.d.ts +1 -1
- package/package.json +1 -1
- package/src/assertion.ts +1 -1
- package/src/constrain.ts +2 -2
- package/src/format-date.ts +1 -1
- package/src/format-selected-date.ts +1 -1
- package/src/format-visible-range.ts +1 -1
- package/src/get-month-days.ts +1 -1
- package/src/get-start-of-week.ts +1 -1
- package/src/get-weekday-formats.ts +1 -1
- package/src/mutation.ts +8 -1
- package/src/pagination.ts +8 -1
package/dist/assertion.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue } from "@internationalized/date";
|
|
1
|
+
import { type DateValue } from "@internationalized/date";
|
|
2
2
|
import type { DateAvailableFn } from "./types";
|
|
3
3
|
export declare function isTodayDate(date: DateValue, timeZone: string): boolean;
|
|
4
4
|
export declare function isDateEqual(dateA: DateValue, dateB?: DateValue | null): boolean;
|
package/dist/constrain.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateDuration, DateValue } from "@internationalized/date";
|
|
1
|
+
import { type DateDuration, type DateValue } from "@internationalized/date";
|
|
2
2
|
export declare function alignCenter(date: DateValue, duration: DateDuration, locale: string, min?: DateValue, max?: DateValue): DateValue;
|
|
3
3
|
export declare function alignStart(date: DateValue, duration: DateDuration, locale: string, min?: DateValue, max?: DateValue): DateValue;
|
|
4
4
|
export declare function alignEnd(date: DateValue, duration: DateDuration, locale: string, min?: DateValue, max?: DateValue): DateValue;
|
package/dist/format-date.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateValue } from "@internationalized/date";
|
|
1
|
+
import { type DateValue } from "@internationalized/date";
|
|
2
2
|
export declare function formatSelectedDate(startDate: DateValue, endDate: DateValue | null, locale: string, timeZone: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateValue } from "@internationalized/date";
|
|
1
|
+
import { type DateValue } from "@internationalized/date";
|
|
2
2
|
export declare function formatVisibleRange(startDate: DateValue, endDate: DateValue | null, locale: string, timeZone: string): string;
|
package/dist/get-month-days.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DateValue } from "@internationalized/date";
|
|
1
|
+
import { type DateValue } from "@internationalized/date";
|
|
2
2
|
export declare function getDaysInWeek(weekIndex: number, from: DateValue, locale: string, firstDayOfWeek?: number): DateValue[];
|
|
3
3
|
export declare function getMonthDays(from: DateValue, locale: string, numOfWeeks?: number, firstDayOfWeek?: number): DateValue[][];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CalendarDate, CalendarDateTime, ZonedDateTime, DateValue } from '@internationalized/date';
|
|
1
|
+
import type { CalendarDate, CalendarDateTime, ZonedDateTime, type DateValue } from '@internationalized/date';
|
|
2
2
|
export declare function getStartOfWeek(date: DateValue, locale: string, firstDayOfWeek?: number): CalendarDate | CalendarDateTime | ZonedDateTime;
|
package/dist/mutation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarDate, CalendarDateTime, ZonedDateTime, Calendar, DateValue } from '@internationalized/date';
|
|
1
|
+
import type { CalendarDate, CalendarDateTime, ZonedDateTime, type Calendar, type DateValue } from '@internationalized/date';
|
|
2
2
|
import type { DateAvailableFn } from "./types";
|
|
3
3
|
export declare function getTodayDate(timeZone?: string): CalendarDate;
|
|
4
4
|
export declare function getNextDay(date: DateValue): CalendarDate | CalendarDateTime | ZonedDateTime;
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalendarDate, CalendarDateTime, ZonedDateTime, DateDuration, DateValue } from '@internationalized/date';
|
|
1
|
+
import type { CalendarDate, CalendarDateTime, ZonedDateTime, type DateDuration, type DateValue } from '@internationalized/date';
|
|
2
2
|
export declare function getAdjustedDateFn(visibleDuration: DateDuration, locale: string, minValue?: DateValue, maxValue?: DateValue): (options: {
|
|
3
3
|
startDate: DateValue;
|
|
4
4
|
focusedDate: DateValue;
|
package/package.json
CHANGED
package/src/assertion.ts
CHANGED
package/src/constrain.ts
CHANGED
package/src/format-date.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue, endOfMonth, isSameDay, startOfMonth } from "@internationalized/date"
|
|
1
|
+
import { type DateValue, endOfMonth, isSameDay, startOfMonth } from "@internationalized/date"
|
|
2
2
|
import { getDayFormatter } from "./get-day-formatter"
|
|
3
3
|
import { getMonthFormatter } from "./get-month-formatter"
|
|
4
4
|
|
package/src/get-month-days.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue, getWeeksInMonth, isSameDay } from "@internationalized/date"
|
|
1
|
+
import { type DateValue, getWeeksInMonth, isSameDay } from "@internationalized/date"
|
|
2
2
|
import { getStartOfWeek } from "./get-start-of-week"
|
|
3
3
|
|
|
4
4
|
export function getDaysInWeek(weekIndex: number, from: DateValue, locale: string, firstDayOfWeek?: number) {
|
package/src/get-start-of-week.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue, getDayOfWeek } from "@internationalized/date"
|
|
1
|
+
import { type DateValue, getDayOfWeek } from "@internationalized/date"
|
|
2
2
|
|
|
3
3
|
export function getStartOfWeek(date: DateValue, locale: string, firstDayOfWeek: number = 0) {
|
|
4
4
|
const day = getDayOfWeek(date, locale)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue, DateFormatter } from "@internationalized/date"
|
|
1
|
+
import { type DateValue, DateFormatter } from "@internationalized/date"
|
|
2
2
|
|
|
3
3
|
export function getWeekdayFormats(locale: string, timeZone: string) {
|
|
4
4
|
const longFormat = new DateFormatter(locale, { weekday: "long", timeZone })
|
package/src/mutation.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type Calendar,
|
|
3
|
+
type DateValue,
|
|
4
|
+
getLocalTimeZone,
|
|
5
|
+
toCalendar,
|
|
6
|
+
toCalendarDateTime,
|
|
7
|
+
today,
|
|
8
|
+
} from "@internationalized/date"
|
|
2
9
|
import { constrainValue } from "./constrain"
|
|
3
10
|
import type { DateAvailableFn } from "./types"
|
|
4
11
|
|
package/src/pagination.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type DateDuration,
|
|
3
|
+
type DateValue,
|
|
4
|
+
endOfMonth,
|
|
5
|
+
endOfWeek,
|
|
6
|
+
startOfMonth,
|
|
7
|
+
startOfWeek,
|
|
8
|
+
} from "@internationalized/date"
|
|
2
9
|
import { isDateInvalid } from "./assertion"
|
|
3
10
|
import { alignEnd, alignStart, constrainStart, constrainValue } from "./constrain"
|
|
4
11
|
import { getEndDate, getUnitDuration } from "./duration"
|