@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.
@@ -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;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { DateValue } from "@internationalized/date";
1
+ import { type DateValue } from "@internationalized/date";
2
2
  /**
3
3
  * Formats a date using the given format string as defined in:
4
4
  * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
@@ -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;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { DateValue } from "@internationalized/date";
1
+ import { type DateValue } from "@internationalized/date";
2
2
  export declare function getWeekdayFormats(locale: string, timeZone: string): <T extends DateValue | Date>(value: T) => {
3
3
  value: T;
4
4
  short: string;
@@ -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;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/date-utils",
3
- "version": "0.0.0-dev-20230605160807",
3
+ "version": "0.0.0-dev-20230605180544",
4
4
  "description": "Date utilities for zag.js",
5
5
  "keywords": [
6
6
  "js",
package/src/assertion.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DateValue, isSameDay, isToday } from "@internationalized/date"
1
+ import { type DateValue, isSameDay, isToday } from "@internationalized/date"
2
2
  import type { DateAvailableFn } from "./types"
3
3
 
4
4
  export function isTodayDate(date: DateValue, timeZone: string) {
package/src/constrain.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
- DateDuration,
3
- DateValue,
2
+ type DateDuration,
3
+ type DateValue,
4
4
  maxDate,
5
5
  minDate,
6
6
  startOfMonth,
@@ -1,4 +1,4 @@
1
- import { DateValue, toCalendarDateTime } from "@internationalized/date"
1
+ import { type DateValue, toCalendarDateTime } from "@internationalized/date"
2
2
 
3
3
  function createRegEx(sign: string) {
4
4
  let symbols = "\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;"
@@ -1,4 +1,4 @@
1
- import { DateValue, isSameDay } from "@internationalized/date"
1
+ import { type DateValue, isSameDay } from "@internationalized/date"
2
2
  import { formatRange } from "./format-range"
3
3
  import { getDayFormatter } from "./get-day-formatter"
4
4
 
@@ -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
 
@@ -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) {
@@ -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 { Calendar, DateValue, getLocalTimeZone, toCalendar, toCalendarDateTime, today } from "@internationalized/date"
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 { DateDuration, DateValue, endOfMonth, endOfWeek, startOfMonth, startOfWeek } from "@internationalized/date"
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"