isSameDay

Commons
stable

Returns true when two Date objects fall on the same calendar day (same date, month, and year in local timezone). Used in date pickers and calendar views to highlight selected or today cells.

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. Day, month, and full year must all match for the function to return true.

API

Valeur de retour

La valeur retournée par cet util.

true when date and comparing share the same local calendar day; false when any of day, month, or year differ.

Usage

Exemples

Extraits de code prêts à coller.

Comparing two dates for same-day equality

typescript