Skip to content

Commit 204048f

Browse files
Update month parameter to monthIndex and add docs for Date constructor
Signed-off-by: jmorrison152 <[email protected]>
1 parent 44d6b51 commit 204048f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/lib/es5.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,17 @@ interface Date {
888888
interface DateConstructor {
889889
new(): Date;
890890
new(value: number | string): Date;
891-
new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
891+
/**
892+
* Creates a new Date.
893+
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
894+
* @param monthIndex The month as a number between 0 and 11 (January to December).
895+
* @param date The date as a number between 1 and 31.
896+
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
897+
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
898+
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
899+
* @param ms A number from 0 to 999 that specifies the milliseconds.
900+
*/
901+
new(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
892902
(): string;
893903
readonly prototype: Date;
894904
/**
@@ -899,14 +909,14 @@ interface DateConstructor {
899909
/**
900910
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
901911
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
902-
* @param month The month as a number between 0 and 11 (January to December).
912+
* @param monthIndex The month as a number between 0 and 11 (January to December).
903913
* @param date The date as a number between 1 and 31.
904914
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
905915
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
906916
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
907917
* @param ms A number from 0 to 999 that specifies the milliseconds.
908918
*/
909-
UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
919+
UTC(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
910920
now(): number;
911921
}
912922

0 commit comments

Comments
 (0)