Copy link to clipboard
Copied
I have built a timesheet for my employees but unfortunately it confuses some. I need it so you insert the date for the last day of the week and then it automatically fills in the dates next to the corresponding day. For example.
11/02/2020 Wednesday.
Please help
Copy link to clipboard
Copied
Is that mm/dd/yyyy or dd/mm/yyyy? Either way, it's not a Wednesday...
Anyway, you can do it by creating two fields. Let's say the are called Date1 and Day1. As the custom calculation script of the latter enter the following code:
var s1 = this.getField("Date1").valueAsString;
if (s1=="") event.value = "";
else {
var d1 = util.scand("dd/mm/yyyy", s1);
event.value = util.printd("dddd", d1);
}
Make sure to adjust the first date format string to match the one you're using in Date1, of course...