Вопрос

The start date and end date i stored to database is difference when it display to scheduler, i found that when i parse

            DataTable dt = SchedulerDAL.Scheduler_SelectByUserIdAndIsActive(userId, isActive);
        List<Scheduler> schedulerList = new List<Scheduler>();
        for (int i = 0; i < dt.Rows.Count; i++)
        {                
            Scheduler scheduler = new Scheduler();
            scheduler.Description = dt.Rows[i]["Description"].ToString();
            scheduler.End = DateTime.Parse(dt.Rows[i]["DateEnd"].ToString());
            scheduler.Start = DateTime.Parse(dt.Rows[i]["DateStart"].ToString());
            scheduler.IsAllDay = bool.Parse(dt.Rows[i]["IsAllDay"].ToString());
            scheduler.RecurrenceException = dt.Rows[i]["RecurrentException"].ToString();
            if (!string.IsNullOrEmpty(dt.Rows[i]["RecurrentId"].ToString()))
            {
                scheduler.RecurrenceID = int.Parse(dt.Rows[i]["RecurrentId"].ToString());
            }
            scheduler.RecurrenceRule = dt.Rows[i]["RecurrentRule"].ToString();
            scheduler.TaskID = int.Parse(dt.Rows[i]["Id"].ToString());
            scheduler.Title = dt.Rows[i]["Title"].ToString();

            schedulerList.Add(scheduler);

        }
        return schedulerList;

when i parse the datestart & dateend it will be different with my server data, it seem like -8 hour, anyone know why cause this? I using en-GB culture and my pc time format is GMT+8.00

Это было полезно?

Решение

Set the timezone option of the scheduler. It is used to tell the scheduler in what timezone the scheduler events are created and stored on the server. If the timezone is not set the scheduler will use the current timezone.

This means that users with different timezone settings will see different start and end times. Setting the timezone of the scheduler would make it display the same start and end times regardless of the current user timezone.

Stolen from here

Try Using:

$("#scheduler").kendoScheduler({
     timezone: "specify the timezone here"
});
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top