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
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- daterequiredDate
- The first date to compare.
- comparingrequiredDate
- The second date to compare against. Only the full year (getFullYear()) is compared.
API
Return value
The value returned by this util.
- true when both dates have the same full year; false otherwise.
Usage
Examples
Ready-to-paste usage snippets.
Comparing dates for same-year equality