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

Scheduler keeps adjusting times

1 Answer 71 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 12 Sep 2015, 09:29 PM

I am using the scheduler binding to local data from my viewmodel.  The scheduler is set to TimeZone of "Etc/UTC" and all the dates are stored as UTC however they are all adjusted in the scheduler. How can I turn off scheduler timezone adjustments. There  should be nothing to adjust to since everything is UTC!

Honestly, I keep running into problem after problem with these products and I think that $2,000 was a big mistake.

1 Answer, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 13 Sep 2015, 05:43 PM

Okay so for anyone else stumbling onto this thread via a search, I did find a solution to my problem. As it turns out, the scheduler seems to ignore the StartTimeZone and EndTimeZone fields of the ISchedulerEvent interface (why have them then?) and just looks for the date/time kind of the datetime start and end fields.  Although I did specify this in my initial seeding and the values were stored in the database fine, there was an issue using automapper to transfer these fields over to my viewmodels.

The fix was to specify the datetimekind of the view model when it was set like so:

private DateTime start;
[Required(ErrorMessage = "The event start date and time are required")]
public DateTime Start
{
get { return start; }
set { start = new DateTime(value.Ticks, DateTimeKind.Utc); }
}
private DateTime end;
[Required(ErrorMessage = "The event end date and time are required")]
public DateTime End
{
get { return end; }
set { end = new DateTime(value.Ticks, DateTimeKind.Utc); }
}

Tags
Scheduler
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Share this question
or