isSameYear

Commons
stable

Returns true when two Date objects fall in the same calendar year. Used in year pickers and date range validation.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

date
requis
Date
The first date to compare.
comparing
requis
Date
The second date to compare against. Only the full year (getFullYear()) is compared.

API

Valeur de retour

La valeur retournée par cet util.

true when both dates have the same full year; false otherwise.

Usage

Exemples

Extraits de code prêts à coller.

Comparing dates for same-year equality

typescript