Scheduler keeps adjusting times

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    7 posts
    Member since:
    Jul 2015

    Posted 12 Sep 2015 Link to this post

    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.

  2. Andrew
    Andrew avatar
    7 posts
    Member since:
    Jul 2015

    Posted 13 Sep 2015 in reply to Andrew Link to this post

    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); }
    }

  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top