Skip to content

Commit 1e5ffe4

Browse files
committed
fix: remove ImmutableDate TS interface, accept Date
This reverts commit 6d96322.
1 parent 71aa412 commit 1e5ffe4

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

src/dates.d.ts

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -81,63 +81,6 @@ export interface DateFormatOptions {
8181
timeZoneName?: 'short' | 'long';
8282
}
8383

84-
/** A Date-like object that provides read-only access to the date parts. */
85-
export interface ImmutableDate {
86-
/** Gets the time value in milliseconds. */
87-
getTime(): number;
88-
89-
/** Gets the year, using local time. */
90-
getFullYear(): number;
91-
92-
/** Gets the year using Universal Coordinated Time (UTC). */
93-
getUTCFullYear(): number;
94-
95-
/** Gets the month, using local time. */
96-
getMonth(): number;
97-
98-
/** Gets the month of a Date object using Universal Coordinated Time (UTC). */
99-
getUTCMonth(): number;
100-
101-
/** Gets the day-of-the-month, using local time. */
102-
getDate(): number;
103-
104-
/** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
105-
getUTCDate(): number;
106-
107-
/** Gets the day of the week, using local time. */
108-
getDay(): number;
109-
110-
/** Gets the day of the week using Universal Coordinated Time (UTC). */
111-
getUTCDay(): number;
112-
113-
/** Gets the hours in a date, using local time. */
114-
getHours(): number;
115-
116-
/** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
117-
getUTCHours(): number;
118-
119-
/** Gets the minutes of a Date object, using local time. */
120-
getMinutes(): number;
121-
122-
/** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
123-
getUTCMinutes(): number;
124-
125-
/** Gets the seconds of a Date object, using local time. */
126-
getSeconds(): number;
127-
128-
/** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
129-
getUTCSeconds(): number;
130-
131-
/** Gets the milliseconds of a Date, using local time. */
132-
getMilliseconds(): number;
133-
134-
/** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
135-
getUTCMilliseconds(): number;
136-
137-
/** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
138-
getTimezoneOffset(): number;
139-
}
140-
14184
/**
14285
* Converts a `Date` object to a string based on the specified format and locale.
14386
*
@@ -146,7 +89,7 @@ export interface ImmutableDate {
14689
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
14790
* @returns - The formatted date.
14891
*/
149-
export function formatDate(value: Date | ImmutableDate, format: string|DateFormatOptions, locale?: string): string;
92+
export function formatDate(value: Date, format: string|DateFormatOptions, locale?: string): string;
15093

15194
/**
15295
* Converts a string to a `Date` object based on the specified format and locale.

0 commit comments

Comments
 (0)