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

What API call to display week view with respect to todays date and time start of 7am

3 Answers 64 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 26 Aug 2013, 08:18 PM
I tried to display the week format format for the current week for my calendar app, but it is not working for having the day start time of 7am. Is there a way to do this? This is my API rendering call:

$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->timezone("Etc/UTC")
          ->date(new DateTime())
          ->height(600)
          ->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 7:00')),
            array('type' => 'week', 'selected' => true, 'startTime' => new DateTime('2013/6/13 7:00')), 'month', 'agenda')
          ->dataSource($dataSource);

It does show the week of "August 26th", but, it starts to display 1am instead of 7am??

paul

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 Aug 2013, 07:12 AM
Hi Paul,

I suspect that this behavior is caused by incorrect timezone setting of the DateTime object. Could you please try providing the timezone when constructing the DateTime object and see if there is any difference. 

$scheduler->timezone("Etc/UTC")
          ->date(new DateTime())
          ->height(600)
          ->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 7:00', new DateTimeZone('UTC'))),
            array('type' => 'week', 'selected' => true, 'startTime' => new DateTime('2013/6/13 7:00', new DateTimeZone('UTC'))), 'month', 'agenda')
          ->dataSource($dataSource);


Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Pavel
Top achievements
Rank 1
answered on 28 Aug 2013, 07:10 PM
If I set everything to UTC and provide a time value of 11:00, then it changes to 7:00am for my local timezone display which id EDT (UTC - 4hours), if I am not mistaken. Do I just have to use UTC for any sort of timezone configuration and it will display in local based on browser/PC time?
0
Rosen
Telerik team
answered on 29 Aug 2013, 08:56 AM
Hi Paul,

Generally speaking for these setting (start/end time, date etc.) you should set the timezone to be the same as the one that client browser is using. If the client is in the same timezone as the server or if all the clients are in the same timezone you could hardcode it in the definition. However, if the client timezone varies you should adopt a way to retrieve it prior declaring the scheduler. You can find various resources on how to implement this on the internet, for example

Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Scheduler
Asked by
Pavel
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or