techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Ability to add firstDayOfWeek function #10

Closed tsharp-decimal closed 5 years ago

tsharp-decimal commented 5 years ago

On the Nova DateTime field there is an ability to change the first day of the week on the calendar.

Is it possible to introduce this functionality to IntlDateTime?

Customizing The First Day of the Week

By default, Nova's Date and DateTime fields recognize Sunday as the first day of the week (as the >United States, Canada, and Japan do). If you wish to customize this to follow the international >standard ISO 8601, you can set the firstDayOfWeek option on the field:

Date::make('Birthday')->firstDayOfWeek(1); DateTime::make('Created At')->firstDayOfWeek(1);

techouse commented 5 years ago

This should theoretically be possible, however usually you'd rely on the provided Flatpickr locale and Moment locale to set this for you automatically.

techouse commented 5 years ago

v.1.2.5 now features the option to override firstDayOfWeek just like you would in the native Nova Date and/or DateTime field.