FirstDay of week for Kendo UI DatePicker for Angular

7 posts, 0 answers
  1. Mike
    Mike avatar
    7 posts
    Member since:
    Oct 2008

    Posted 10 Oct 2017 Link to this post

    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

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 12 Oct 2017 Link to this post

    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.
  3. Sumanth
    Sumanth avatar
    3 posts
    Member since:
    Jan 2018

    Posted 07 Sep in reply to Georgi Krustev Link to this post

    Hi Georgi,

     

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

  4. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    921 posts

    Posted 07 Sep Link to this post

    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.
  5. Sumanth
    Sumanth avatar
    3 posts
    Member since:
    Jan 2018

    Posted 07 Sep in reply to Dimiter Topalov Link to this post

    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?

  6. Sumanth
    Sumanth avatar
    3 posts
    Member since:
    Jan 2018

    Posted 07 Sep in reply to Dimiter Topalov Link to this post

    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

     

  7. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    921 posts

    Posted 11 Sep Link to this post

    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.
Back to Top