// Get the current date
const currentDate = new Date();
// Get the day, month, and year
const day = currentDate.getDate();
const month = currentDate.getMonth() + 1; // Month is zero-indexed, so add 1
const year = currentDate.getFullYear();
// Format the date as needed
const formattedDate = `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`;
// Print the formatted date
return(day);
The outcome i want is to use if compare today date
if 1-5 day choice1
if 12 day choice 2
…
However, that still won’t help you as the JavaScript column returns a string, which can’t be used in a numerical comparison.
A better approach here is to use a Math column with the following formula: Day(Now), where Now is the current date/time. This will return a number, which can be used directly in your if-then-else column.