Skip to content

Commit

Permalink
Clarify CalendarDate type restrictions in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
1amageek committed Nov 26, 2024
1 parent 6f4a9b7 commit d4762fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@internationalized/date/src/CalendarDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function shiftArgs(args: any[]) {
/** A CalendarDate represents a date without any time components in a specific calendar system. */
export class CalendarDate {
// This prevents TypeScript from allowing other types with the same fields to match.
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
// If that behavior is desired, use the AnyCalendarDate interface instead.
// @ts-ignore
#type;
/** The calendar system associated with this date, e.g. Gregorian. */
Expand Down

0 comments on commit d4762fc

Please sign in to comment.