How to set business hours day wise?

4 posts, 0 answers
  1. Varinder
    Varinder avatar
    5 posts
    Member since:
    Apr 2020

    Posted 15 Apr 2020 Link to this post

    Hi,

    I have requirement to set different business hours for different day.

    For example on Monday from 8:00 AM to 4:00 PM and on Tuesday from 11:00 AM to 7:00 PM and so on.

    Need help on this how I can achieve this in Kendo Scheduler.

    Thanks

  2. Misho
    Admin
    Misho avatar
    240 posts

    Posted 17 Apr 2020 Link to this post

    Hello,

    Setting business hours is supported as a global option for the scheduler through the workdaystart and workdayend options.

    You could however implement the custom logic and set the business hours dynamically by modifying these options and refreshing the view. Here you can find test sample which illustrates this:

    https://dojo.telerik.com/iWeqoQub 

    You might also find more information on the matter in the following forum threads:

    https://www.telerik.com/forums/customize-business-hours 

    https://www.telerik.com/forums/dynamically-change-business-hours- 

    https://www.telerik.com/forums/setting-work-hours-different-days

    Best Regards,
    Misho
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. K.Ramadan
    K.Ramadan avatar
    81 posts
    Member since:
    Feb 2020

    Posted 04 Jan in reply to Misho Link to this post

    Hello,

    I am trying to achieve what you did in your Dojo example, but I'm stumbling upon a problem.

    First of all, this part in your example :

    var start = new Date("2013/6/13 08:00 AM");
    var end = new Date("2013/6/13 05:00 PM");
     
    //set the scheduler options
    scheduler.options.workDayStart = start;
    scheduler.options.workDayEnd = end;

     

     

     

    It's only changing the time (date will be ignored), should it work like this ?

    if so, then it's a global option that i can use, but not for specific day !

    and if I change the 12 hour format to 24 hour format, then it doesn't change the time either !

    let start = new Date("2013/6/13 09:00 AM");
    let end = new Date("2013/6/13 05:00 PM");
     
    // this does not work
    let start1 = new Date("2013/6/13 09:00");
    let end1 = new Date("2013/6/13 17:00");

     

    Am I missing something here ?

    Because all the variables are giving exactly the same output  !

     

    thanks in advance

     

    K.Ramadan

  4. Misho
    Admin
    Misho avatar
    240 posts

    Posted 06 Jan Link to this post

    Hello Karam,

    Than you for your feedback. 

    In the Dojo example I setting the new values for start and end of the working day through the workdaystart and workdayend configuration options. 

    These values should be a valid JavaScript Date object. You could find different kinds of formats that are supported in the following article:

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date 

    These options are global and not relevant for specific day only.

    Here is an example with 24 hour format: https://dojo.telerik.com/iWeqoQub/10 

    I hope this helps.

    Best Regards,
    Misho
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top