How to auto-populate field with abbreviated day of week (SU, MO, etc.) based on entry in other field
Hi!
I set up 7 fields:
FIELD02, FIELD03, FIELD04, FIELD05, FIELD06, FIELD07, FIELD08
to automatically populate with the days of the week:
SU, MO, TU, WE, TH, FR, SA
based on the user's entry in FIELD01, which is a "week ending date" formatted as "Date" and "mm/dd/yyyy".
I put the following formula into the 7 fields, with the -6 changing to -5, -4, -3, -2, -1, -0 for each field:
var s = this.getField("FIELD01").valueAsString;
if (s=="") event.value = "";
else {
var d = util.scand("mm/dd/yyyy", s);
d.setDate(d.getDate()-6);
event.value = util.printd("ddd", d);
}
Success, it worked! Except that the days of the week are displaying as:
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Is there a way to make the auto-entries be 2 characters and all upper-case (SU, MO, TU, etc.)? I'm guessing it's the "ddd" that's doing it and I don't know if there's something to use in its place ("DD" didn't work). Or if it must be 3 characters can they all be upper-case?
Thank you so much! You all are so awesome in your help here!
Diane
