Return the last day of a year for the given date.
Return the last day of a year for the given date. The result will be in the local timezone.
// CommonJS
var lastDayOfYear = require('date-fns/lastDayOfYear')
// ES 2015 import lastDayOfYear from 'date-fns/lastDayOfYear'
// ESM
import { lastDayOfYear } from 'date-fns'
lastDayOfYear(date)
| Name | Description |
|---|---|
date |
the original date |
| Description |
|---|
|
the last day of a year |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// The last day of a year for 2 September 2014 11:55:00: const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) //=> Wed Dec 31 2014 00:00:00
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/lastDayOfYear