Events: Can't set StartDate or EndDate correctly

Posted by Community Admin on 04-Aug-2018 05:27

Events: Can't set StartDate or EndDate correctly

All Replies

Posted by Community Admin on 04-Jan-2011 00:00

Issues: Create a new event (the one and only event in the system) set the Start Date and Start Time to March 15, 2011 10am and it gets stored in the database as March 15 2011, 2pm. For some reason it adds 4 hours and the same happens to the End Date.
The last modified date as stored in the database is my current system time (developing locally so I know clock is right) is 5hrs ahead.
Finally, I change the pulished date to yesterday and that is stored in the database correctly, however when I debug and walk through the code, the Event object PublicationDate is giving me the LastModifiedDate.

Version: Current RC2 build

Not sure about other SF users, but an Event module that you can't actually set the date and time of your event is pretty useless.

Regards,
Phill

Posted by Community Admin on 17-Jan-2011 00:00

Hello Phill,

I couldn't reproduce your problem. All dates are stored in the database in UTC. So, for example, if you create an event with start date March 15, 2011, 10:00 am, and your time zone is UTC+2, in the database the time is stored as 8:00 am, which is a normal behavior.

Greetings,
Petya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Jan-2011 00:00

Hi Petya,

This is still an issue, can you try again and follow these steps:
1. Create an Event
2. Set Start DateTime to February 1st, 9:00:00 am
3. Set End DateTIme to February 1st, 9:00:01 am
4. Look this event up in the database and you'll see that the Start Date and End Date are an hour apart, not one second.

My goal here is to have an Event where the Start and End date are the same but the UI won't let me, which I think it should. The check should be >= not just > or I should be able to create an event with EndDate empty/null (i.e. a reminder vs. an event with a duration). You're explanation of the time offset makes sense, what was throwing me off is that the enddate is automatically being bumped by an hour.

Regards,
Phill

Posted by Community Admin on 17-Jan-2011 00:00

Hi Phill ,

I'm sending you an attachment how this event is created on my machine and how it is stored in the database. I still have problems reproducing your issue. Can you tell me what time zone settings and regional settings you are using. Also where is your SQL server located and what are its time settings.

According to your goal to create an event with equal start and end date - it's actually not possible to have some event starting and ending at the same time that's why the check is > not >= by design. Your other idea - to be able to create event with empty end date is acceptable for now, so we will log it as a new task which should be implemented

 

Best wishes,
Petya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 25-Jan-2011 00:00

I am experiencing the same issue. I've attached internal.png, a screenshot of the currently entered date and time for an event, and external.png which shows the date and time as displayed on the published page. Was this ever resolved with Phill?

Thanks,
Zak

Posted by Community Admin on 27-Jan-2011 00:00

Hi Zak,

I think that your problem is a little different than Phill's. The event start and end date appear on the public part in UTC, which is not correct - we already logged this as a bug with ID 105128 and it will be fixed in some of our next internal releases.

 
Greetings,

Petya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Mar-2011 00:00

Has the UTC issue been fixed in a release yet? Can't believe during testing nobody created and event and then looked at it and noticed the date had been changed by hours.

Posted by Community Admin on 18-Mar-2011 00:00

Hi ,

The status of the issue is Not Done, but it with high priority and we are going to work on it. We will try to fix it for Q1.

Kind regards,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 23-Mar-2011 00:00

Storing the date/time in UTC wouldn't be an issue if it read the browser or system (server) localization correctly - which it doesn't.

For now is the suggested workaround to compensate the event time by whatever your local offset to UTC happens to be?

Posted by Community Admin on 28-Mar-2011 00:00

Hi Jason,

Could you check the values that are saved inside [sf_events] table for  [event_end] and [event_start]? Generally this is the value that will be displayed by the public control. You can pass this value to the code below

   public  DateTime ToLocal(this DateTime value)
       
            var timeZoneInfo = UserManager.GetManager().GetUserTimeZone();
            return TimeZoneInfo.ConvertTime(value, timeZoneInfo);
       

This is what the public control returns if the Event_Start and Event_End are added by filed controls in the template you use.

Kind regards,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 29-Mar-2011 00:00

Hi Ivan,

The values are as follows:

[sf_events].[event_end]: 2011-02-09 20:00:00.000
[sf_events].[event_start]: 2011-02-09 18:00:00.000

In the default administration interface for the event (/Sitefinity/Content/Events):
Event End: 02/09/2011 2:00:00 PM
Event Start: 02/09/2011 12:00:00 PM

The General Settings for Time zone is set to "(UTC-06:00) Central Time (US & Canda)". While I understand that what your ToLocal() is doing, I still feel this is a bug since the data should be stored and displayed consistently.

Posted by Community Admin on 01-Apr-2011 00:00

Hello Jason,

Can you edit the template of the events widget and put the format to the FieldListView control with ID EventsDates

Format=" | Event_Start.ToLocal():  dd MMM, '\''yy" />

All the best,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 14-Nov-2012 00:00

I'd like to put my $0.02 in on this conversation. I would like to see one of two options:

  • Dates on Events stored as entered, with no conversion to UTC
  • The ability to specify the time zone on the event itself
The issue we have is that not all our events occur or should be displayed in our local time zone. We may do a west coast event that we want to display in PST. Since many of our events are physical gatherings, not webinars, it's pretty important that the time be displayed as local to the place where the event is happening.

For now, we'll just have to hack the date to make it show the correct date, but this solution is far from ideal.

Josh

Posted by Community Admin on 16-Nov-2012 00:00

Hi,

it's an old issue : 
www.sitefinity.com/.../events-date-start-and-end


Regards,
Nicolas

Posted by Community Admin on 17-Nov-2012 00:00

Hello Josh,

Thank you for your feedback. I have created a feature request in PITS.

Regards,
Randy Hodge
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed