First day of week

I’d like to get the the first day of week from OS X System Preferences / Language & Region so user wouldn’t need to set it again in my app. Does anyone know a way? Thanks.

[code]Declare Function NSClassFromString Lib “Foundation” (className As CFStringRef) As Ptr
Declare Function currentCalendar Lib “Foundation” Selector “currentCalendar” (NSCalendarClass As Ptr) As Ptr
Declare Function firstWeekday Lib “Foundation” Selector “firstWeekday” (NSCalendar As Ptr) As UInt32

Dim calendarClass As Ptr = NSClassFromString(“NSCalendar”)
Dim currentCalendar As Ptr = currentCalendar(calendarClass)
Dim firstWeekday As Integer = firstWeekday(currentCalendar)[/code]

USA -> firstWeekday is 1 -> Sunday
Germany -> firstWeekday is 2 -> Monday

You can change the Region in the Preferences’ Language & Region section to test this.

Nice, thank you very much!