I have a form I am designing. Users will input a week ending date (05/09/2020), and I want this to then populate text boxes with the dates for sunday through saturday, i.e. the textbox named Sun would fill with the number 3 (for May 3), textbox named Mon would fill with the number 4 (for May 4) and so on for each day of the week. Is there a format to accomplish this? I assume I could use the date 05/09/2020, and use a script to subtract the number of days I needed to get the right date.
Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
with FormCalc you can easily calculate dates.
In the exit event of you date field, add a script like this
if ($.isNull eq 0) then
var nDate = Date2Num($.formattedValue, "MM/DD/YYYY")
Mon = Num2Date(nDate - 6, "EEE D")
Tue = Num2Date(nDate - 5, "EEE D")
Wed = Num2Date(nDate - 4, "EEE D")
; and so on ...
endif
Hi,
with FormCalc you can easily calculate dates.
In the exit event of you date field, add a script like this
if ($.isNull eq 0) then
var nDate = Date2Num($.formattedValue, "MM/DD/YYYY")
Mon = Num2Date(nDate - 6, "EEE D")
Tue = Num2Date(nDate - 5, "EEE D")
Wed = Num2Date(nDate - 4, "EEE D")
; and so on ...
endif