Hallo,
WeekOfMonth = RecurringDay/7 + 1 ;
Das stimmt aber leider nicht.
Der 7.11 z.b. ist der 1. Donnerstag nach deiner Rechnung kommt aber 2 raus.
stimmt! WeekOfMonth = (RecurringDay-1)/7 + 1 ; und das Ganze auch noch abgerundet wäre besser.
und jetzt als ganzes ;-)
function weekOfMonth(date)
{
if(!date) return null;
return pasrseInt((date.getDate() - 1) / 7 + 1);
}