lilcodelab / Xamarin.Plugin.Calendar

Calendar plugin for Xamarin.Forms
MIT License
260 stars 61 forks source link

Can't find code start day of week #100

Closed JanDa-ma closed 3 years ago

JanDa-ma commented 3 years ago

I'm trying to set Monday as the primary day of the week. I read the advanced sample code but I can't find where this is done.

I know, it will be stupid but I can't find it in the xaml.

kvpt commented 3 years ago

The first day of week can't be defined directly.

It is defined trough the culture https://github.com/lilcodelab/Xamarin.Plugin.Calendar/blob/9247986159c3291a8ec2c332a91dc2822ee00030/src/Calendar.Plugin/Shared/Controls/MonthDaysView.xaml.cs#L611

So if you pass the right culture to the calendar (which is also necessary to have the day and month translated) you will have the right first day of week.

Usually the current value (CultureInfo.CurrentUICulture) is sufficient. But if you want have a specific translation and specific first day of week you can also construct a custom CultureInfo it's a native dotNet type.