Optionalmonth: numberIf provided, must be between 1 (January) and 12 (December) inclusive.
Optionalday: numberIf provided, must be between 1 and the number of days in the corresponding month (thus 31 at most).
Construct a DateValue object from a standard JavaScript Date object.
With this constructor, the type of the returned object is always 'ymd' (see DateValue.type).
Day in month, valued between 1 and the number of days in the corresponding month (thus 31 at most).
exception.IllegalArgument if the current type is 'y' or 'ym' (see DateValue.type).
Month index, valued between 1 (January) and 12 (December) inclusive.
exception.IllegalArgument if the current type is 'y' (see DateValue.type).
Convert the current object into a standard JavaScript Date object.
If the type of the current object is 'ym', the returned Date object points at the first day of the corresponding month.
If the type of the current object is 'y', the returned Date object points at the first day of the corresponding year.
Get the date of the game as a human-readable string (e.g. 'November 1955', 'September 4, 2021').
Optionallocales: string | string[]Locales to use to generate the result. If undefined, the default locale of the execution environment is used. See Intl documentation for more details.
Get the date in a PGN format (e.g. '2022.07.19', '2022.07.??' or '2022.??.??' depending on the type of the current object).
Get the date in a compact format (e.g. '2022-07-19', '2022-07-**' or '2022-**-**' depending on the type of the current object).
Type of date value:
'y' means that only the year is defined,'ym' means that the year and the month are defined, but not the day in month,'ymd' means that the exact day is defined.Year (e.g. 2022).
StaticfromParse the given value as a date in PGN format (e.g. '2022.07.19', '2022.07.??' or '2022.??.??').
undefined if the value does not represent a valid date.
StaticfromParse the given value as a date in compact format (e.g. '2022-07-19', '2022-07-**' or '2022-**-**').
undefined if the value does not represent a valid date.
StaticisWhether the given year/month/day would corresponds to a valid date or not.
Optionalmonth: numberOptionalday: number
Date of a chess game. It can be either partially defined (with the year only, or with the year and month but without day of month), or fully defined (with year, month and day of month).
See
Game.date