Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

getDay() get day of week

Topic Labels: Scripting extentions
483 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I’m not great with Scripting, but I can struggle my way through sometimes.

I’m trying to get the day of the week from a Date field type.

Any suggestions on how to accomplish this?

Thanks!

1 Reply 1

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_date_weekday

^ Typical example of how to use .getDay() in javascript.

So you would be doing something like this:

const dateValue = new Date(record.getCellValue("Date field"))
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
const dayOfWeek = days[dateValue.getDay()]