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

How to set business hours day wise?

3 Answers 1500 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Varinder
Top achievements
Rank 1
Varinder asked on 15 Apr 2020, 02:09 PM

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

3 Answers, 1 is accepted

Sort by
0
Misho
Telerik team
answered on 17 Apr 2020, 07:42 AM

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.
0
K.Ramadan
Top achievements
Rank 2
Veteran
answered on 04 Jan 2021, 03:41 PM

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

0
Misho
Telerik team
answered on 06 Jan 2021, 11:36 AM

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/.

Tags
Scheduler
Asked by
Varinder
Top achievements
Rank 1
Answers by
Misho
Telerik team
K.Ramadan
Top achievements
Rank 2
Veteran
Share this question
or