# # # # weekday_util.cfv # # # # # # # get_calendar_first_weekday_or_marked_weekday() # # # subroutine(get_calendar_first_weekday_or_marked_weekday( node profile, string first_or_marked_weekday_node_name), ( # Note, we use first_weekday and marked_weekday of statistics_misc only if they contain a value, # else we use the default lang_stats value! # debug_message("#### get_calendar_first_weekday_or_marked_weekday() \n"); node misc_options = profile . ".statistics.miscellaneous"; int first_or_marked_weekday; if (misc_options?{first_or_marked_weekday_node_name} and (@misc_options{first_or_marked_weekday_node_name} ne "")) then ( # Override default with profile specific value first_or_marked_weekday = @misc_options{first_or_marked_weekday_node_name}; ) else if (?("lang_stats." . first_or_marked_weekday_node_name)) then ( # Use lang_stats default value first_or_marked_weekday = @("lang_stats." . first_or_marked_weekday_node_name); ) else ( first_or_marked_weekday = 1; ); # Fix older profiles where first_weekday or marked_weekday contains a 0 value. # The 0 value must be converted to 1 if (first_or_marked_weekday == 0) then (first_or_marked_weekday = 1); # Return first_or_marked_weekday; )); subroutine(get_calendar_first_weekday( node profile), ( int first_weekday = get_calendar_first_weekday_or_marked_weekday(profile, "first_weekday"); first_weekday; )); subroutine(get_calendar_marked_weekday( node profile), ( int marked_weekday = get_calendar_first_weekday_or_marked_weekday(profile, "marked_weekday"); marked_weekday; ));