dayOfWeek()
Returns the day of the week of a particular date, where 1 = Monday and 7 = Sunday.
Syntax
dayOfWeek(date)
Parameters
Parameter | Type | Description |
|---|---|---|
date | Date | The date to get the day-of-week from |
Return Type
Number
The day of the week. For example, passing in a date that is on a Monday will return 1
Examples
dayOfWeek('2025-05-12')
- Returns 1 because Monday, May 12, 2025 was a Monday.
Related Carrot
- formatDate() - Can also be used to display the full name of the data such as "Monday, May 12, 2025"
