This is a migrated thread and some comments may be shown as answers.

FirstDay of week for Kendo UI DatePicker for Angular

6 Answers 774 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 10 Oct 2017, 03:26 PM

Hi, 

how can I set the first day of the week used by the Kendo UI DatePicker in an Angular 2/4 project?

Thanks,

Mike

6 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 12 Oct 2017, 08:41 AM
Hello Mike,

The first day of the week is controlled by the chosen LOCALE_ID. For instance, if the locale is set up to 'en-GB', then the component will display the week from Monday. Here is a simple plunker demo that demonstrates the required configuration:

http://plnkr.co/edit/tBWDLziqXRrslupopojY?p=preview

Basically, the required culture should be loaded:

https://www.telerik.com/kendo-angular-ui/components/internationalization/loading-data/#toc-loading-pre-built-data

and then the correct LOCALE_ID provider should be defined:

providers:    [{
    // Set default locale to bg-BG
    provide: LOCALE_ID, useValue: 'en-GB'
}]

The component will use the defined LOCALE_ID and will reflect the firstDay configuration as expected.

Regards,
Georgi Krustev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sumanth
Top achievements
Rank 1
answered on 07 Sep 2018, 03:25 PM

Hi Georgi,

 

Thank you for the explanation. The plunker seems to be failing, can you please take a look at it.

0
Dimiter Topalov
Telerik team
answered on 07 Sep 2018, 04:04 PM
Hi Sumanth,

Indeed, in fact due to frequent issues with the Plunkers and the respective required configuration updates, we decided to move all our runnable online demos to StackBlitz instead (as you can see in the documentation site).

That said, I updated the plunker in question so that it can be run as expected:

http://plnkr.co/edit/hQDxFG9TRhMFl6IGFAk1?p=preview

Let me know whether the example can be run with no issues on your end too.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sumanth
Top achievements
Rank 1
answered on 07 Sep 2018, 04:15 PM

Thank you for the quick response, Dimiter.

 

This works for the first day of the week. But, is there a way I can keep my locale to english and set the first day of the week to Monday?

0
Sumanth
Top achievements
Rank 1
answered on 07 Sep 2018, 04:17 PM

Thanks, Dimiter.

 

Is there a way to do this without change the language? I want to continue using English as the language in my application

 

0
Dimiter Topalov
Telerik team
answered on 11 Sep 2018, 08:15 AM
Hi Sumanth,

You can use a locale with English language but different locale settings (like first day of the week), for example - en-GB:

http://plnkr.co/edit/jnCgnOfhFWeZw8CZ9EjN?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Date/Time Pickers
Asked by
Mike
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Sumanth
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or