Get the day of the week of the given date.
Get the day of the week of the given date.
// CommonJS
var getDay = require('date-fns/getDay')
// ES 2015 import getDay from 'date-fns/getDay'
// ESM
import { getDay } from 'date-fns'
getDay(date)
| Name | Description |
|---|---|
date |
the given date |
| Description |
|---|
|
the day of week, 0 represents Sunday |
| Type | Description |
|---|---|
TypeError |
1 argument required |
// Which day of the week is 29 February 2012? const result = getDay(new Date(2012, 1, 29)) //=> 3
© 2021 Sasha Koss and Lesha Koss
Licensed under the MIT License.
https://date-fns.org/v2.29.2/docs/getDay