Quintiq file version 2.0 #parent: #root Method GetWeekOfMonthAndDayOfWeek ( Date date_i, output String weekOfMonth_o, output String dayOfWeek_o ) id:Method_LibCal_dlgEvent_GetWeekOfMonthAndDayOfWeek { #keys: '[131094.0.1707226619]' Body: [* // This logic is used by both "Monthly" and "Yearly". // Determine the occurrence of the day (i.e. the week) within the month. occurrenceOfDay := ( date_i.Day() - 1 ) div 7; weeks := Translations::Pattern_WeekOfMonth().Tokenize( ssMonthlyPatternWeekOfMonth.RowSeparator() ); weekOfMonth_o := weeks.Element( occurrenceOfDay ); // Determine the day of the week. days := Translations::Pattern_Days().Tokenize( ssMonthlyPatternDayOfWeek.RowSeparator() ); dayOfWeek_o := days.Element( date_i.DayOfWeek() - 1 ); *] }