@react-stately/calendar
Advanced tools
Comparing version
{ | ||
"name": "@react-stately/calendar", | ||
"version": "3.0.0-nightly-9bd8a5f19-250304", | ||
"version": "3.0.0-nightly-9d471e48d-250314", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,6 +25,6 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@internationalized/date": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-stately/utils": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-types/calendar": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-types/shared": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@internationalized/date": "3.0.0-nightly-9d471e48d-250314", | ||
"@react-stately/utils": "3.0.0-nightly-9d471e48d-250314", | ||
"@react-types/calendar": "3.0.0-nightly-9d471e48d-250314", | ||
"@react-types/shared": "3.0.0-nightly-9d471e48d-250314", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -31,0 +31,0 @@ }, |
@@ -24,3 +24,3 @@ /* | ||
export function isInvalid(date: DateValue, minValue?: DateValue | null, maxValue?: DateValue | null) { | ||
export function isInvalid(date: DateValue, minValue?: DateValue | null, maxValue?: DateValue | null): boolean { | ||
return (minValue != null && date.compare(minValue) < 0) || | ||
@@ -30,3 +30,3 @@ (maxValue != null && date.compare(maxValue) > 0); | ||
export function alignCenter(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null) { | ||
export function alignCenter(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null): CalendarDate { | ||
let halfDuration: DateDuration = {}; | ||
@@ -44,3 +44,3 @@ for (let key in duration) { | ||
export function alignStart(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null) { | ||
export function alignStart(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null): CalendarDate { | ||
// align to the start of the largest unit | ||
@@ -59,3 +59,3 @@ let aligned = date; | ||
export function alignEnd(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null) { | ||
export function alignEnd(date: CalendarDate, duration: DateDuration, locale: string, minValue?: DateValue | null, maxValue?: DateValue | null): CalendarDate { | ||
let d = {...duration}; | ||
@@ -83,3 +83,3 @@ // subtract 1 from the smallest unit | ||
minValue?: DateValue | null, | ||
maxValue?: DateValue | null) { | ||
maxValue?: DateValue | null): CalendarDate { | ||
if (minValue && date.compare(minValue) >= 0) { | ||
@@ -108,3 +108,3 @@ let newDate = maxDate( | ||
export function constrainValue(date: CalendarDate, minValue?: DateValue | null, maxValue?: DateValue | null) { | ||
export function constrainValue(date: CalendarDate, minValue?: DateValue | null, maxValue?: DateValue | null): CalendarDate { | ||
if (minValue) { | ||
@@ -111,0 +111,0 @@ let newDate = maxDate(date, toCalendarDate(minValue)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
218839
0.11%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated