Last active
July 19, 2024 20:53
-
-
Save typeoneerror/7cc533632c652ae542067c6dcaf5ca67 to your computer and use it in GitHub Desktop.
Formatted Day of Week (Notion Formula)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lets( | |
/* number of day of week, 0-6 (starting with sunday as 0) */ | |
no, prop("Date").formatDate("d").toNumber(), | |
/* day name */ | |
day, prop("Date").formatDate("dddd"), | |
/* save the colors we want for each day */ | |
color, ifs( | |
no == 1, "blue", /* mon */ | |
no == 2, "pink", /* tue */ | |
no == 3, "yellow", /* wed */ | |
no == 4, "purple", /* thu */ | |
no == 5, "orange", /* fri */ | |
no == 6, "green", /* sat */ | |
"red" /* sun */ | |
), | |
/* style the day name with color and background */ | |
day.style("b", color, color + "_background") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment