I want to provide some styles for an application that knows about weekdays and weekends, but I need it to be local. I know Calendar#getFirstDayOfWeek , but this only returns the first day of the week, not the first day of the work week.
For example, in English (Canada) Calendar#getFirstDayOfWeek returns Calendar.SUNDAY , which is the first day of our week. Our work week starts with Calendar.MONDAY , and our weekends are Calendar.SATURDAY and Calendar.SUNDAY .
In English (UK), Calendar#getFirstDayOfWeek returns Calendar.MONDAY , and the first day of their work week is Monday. Their weekends are Calendar.SATURDAY and Calendar.SUNDAY .
Things are becoming complicated for locales such as Hebrew. The first day of their week is Calendar.SUNDAY , but instead of the first day of their working week, Calendar.MONDAY , it is Calendar.SUNDAY . Their weekends are Calendar.FRIDAY and Calendar.SATURDAY . Egypt is the same.
There is only one day off in Iran, Calendar.FRIDAY .
Is there any method in Android for determining weekend days? We have some logic that covers most Western cases, but it is fragile, and a language-compatible platform API would be ideal, but I don't know about that.
Please note that I am not asking for a recommendation on any βbetterβ library or something like that. I ask if there is any such local data on the Android platform at all, and if so, what API calls exist to access that data.
source share