helpful-kilobyte-18816
07/16/2023, 6:06 AMhelpful-kilobyte-18816
07/18/2023, 4:18 AMmelodic-pharmacist-33482
07/18/2023, 9:56 AMhelpful-kilobyte-18816
07/18/2023, 10:53 PMhelpful-kilobyte-18816
07/19/2023, 9:54 PMacceptable-kangaroo-64719
07/20/2023, 11:00 AMjs
const date = new Date(workflow.userDate)
const options = {
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric'
}
const formattedDate = date.toLocaleDateString('en-us', options)
workflow.date = formattedDate
5. After the execute code card, add a text card with @date
written in it.
Test it out and let me know if it works 🙌
https://cdn.discordapp.com/attachments/1130017484725047318/1131541225963524227/image.png▾
https://cdn.discordapp.com/attachments/1130017484725047318/1131541226269712434/image.png▾
https://cdn.discordapp.com/attachments/1130017484725047318/1131541226630418503/image.png▾
helpful-kilobyte-18816
07/20/2023, 8:01 PMacceptable-kangaroo-64719
07/21/2023, 10:33 AMjs
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
console.log(userTimeZone)
const date = luxon.DateTime.fromJSDate(new Date(workflow.userDate), { zone: userTimeZone })
const formattedDate = date.toFormat('cccc, MMMM d, yyyy')
workflow.date = formattedDate
If things are still weird, look in the logs and you should see what time zone it thinks you're in. You can always manually adjust the time zone by changing the zone
param on line 3helpful-kilobyte-18816
07/22/2023, 3:16 AM