I've seen multiple threads asking if there was a way for monthly recurring events to occur based on the weekday and not the date. For example, instead of an event recurring on Sep 1, Oct 1, Nov 1, etc... it would occur on the first Monday of every month. Well - I just figured out a way to make it work for ASP people. In the CAL_ViewBase.class.asp page, find the following code.
Case "MONTH"
tmpDate = CAL_extract("Y-m", thisStartDate) & "-" & CAL_extract("01 H:i:s", startDate)
c_Date = CAL_addDate(tmpDate, CAL_extract("d", startDate)-1, "d")
arrDates = array()
Do While strcomp(c_Date, end_p) <= 0
If strcomp(c_Date, startDate) >=0 And strcomp(c_Date, thisStartDate) >= 0 And CAL_extract("d", c_Date) = CAL_extract("d", startDate) Then
arrDates = KT_array_push(arrDates, c_Date)
End If
tmpDate = CAL_addDate(tmpDate, 1, "m")
c_Date = CAL_addDate(tmpDate, CAL_extract("d", startDate)-1, "d")
Loop
' Create events array;
For indx = 0 to UBound(arrDates)
tmp_sdate = arrDates(indx)
c_Date = CAL_extract("Y-m-d", tmp_sdate) & " 00:00:00"
tmp_edate = CAL_addDate(c_Date, 60 * tmp_hour + tmp_minute, "i")
If strcomp(tmp_edate, tmp_sdate) <= 0 Then
tmp_edate = CAL_addDate(tmp_sdate, 1, "H")
End If
Set tmp_arr = Server.CreateObject("Scripting.Dictionary")
tmp_arr("start") = tmp_sdate
tmp_arr("end") = tmp_edate
tmp_arr("title") = title
tmp_arr("desc") = description
tmp_arr("link") = link
tmp_arr("class") = specificClass
If calendar.typeProp = "view" Then
tmp_arr("link") = KT_addReplaceParam(page, calendar.getDateParam(), KT_convertDate(c_Date, "yyyy-mm-dd HH:ii:ss", KT_db_date_format))
End If
If Not data("body").Exists(c_Date) Then
Set data("body")(c_Date) = Server.CreateObject("Scripting.Dictionary")
End If
&n