I am trying to create a script to calculate how many Mondays, Tuesdays, Wednesdays, etc. are left from the current date within the current month. I do not know how to go about this. Any and all help is appreciated. Thank you in advance.
Views
Replies
Total Likes
Hi,
this is not too difficult to do in FormCalc.
Use this code in a calculate:Event of a text field or numeric field.
It counts how many mondays this month already has had.
var todaysDate = Date2Num(MyDateField1.formattedValue, "DD.MM.YYYY")
var dayNumber = Num2Date(todaysDate, "D")
var dayCount = 0
for i = dayNumber downto 1 step 1 do
if (Num2Date(todaysDate - i, "E") eq 2) then
dayCount = dayCount + 1
endif
endfor
$ = dayCount
Views
Replies
Total Likes