Setting the Month View component to start on Monday instead of Sunday regardless of locale

I didn't see a solution to this in the forum or the manual, but I had a request to make the starting day of the week optional regardless of locale on a month view component. In case anybody else needs this information, here is the simplest way I found to change the starting day without having to globally mess with the locale:

monthView = # Relative path to month view

# Get the gregorian calender from the month view and set the first day of the week to Monday
monthView.cal.firstDayOfWeek = monthView.cal.MONDAY # or monthView.cal.SUNDAY

# Trigger a graphics configuration event to repaint the calendar
monthView.initialize()

I'm not sure how this could be done with the other calendar components because I haven't looked into it, but if anybody wants to post that information here, I imagine it would be useful.

4 Likes