Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar - StartTime and EndTime


Go to End


10 Posts   4010 Views

Avatar
bmc38119

Community Member, 45 Posts

14 September 2009 at 6:17am

Uncle Cheese -

Excellent event calendar module.

I do have one question though. When I add an Event Date and Time, and then go back and edit them, the Start Time and End Times always show in Date Time format (which they should probably only the Time) AND the date is not the same as the entered Event Dates. See screenshot where the Event Start and End dates are both 9/16/2009, but the Start Time and End Times show 9/13/2009. Is there a way to correct this? I noticed that happens on your bluehouse demo as well.

Thanks

Attached Files
Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 September 2009 at 12:51pm

Make sure you're using

CalendarDateTime::set_date_format('mdy') // or "dmy"
CalendarDateTime::set_time_format("12") // or "24"
DatePickerField::set_date_format('mdy') // or 'dmy'

Avatar
bmc38119

Community Member, 45 Posts

14 September 2009 at 5:58pm

Edited: 14/09/2009 5:58pm

still does not work. in fact, now that the date has changed this morning, the dates in front of the times have now changed to 9/14 - even though the actual start Date and End Dates are set to 9/7 (as before). It looks like it is pulling in the current date infront of the time in those 2 fields.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

15 September 2009 at 2:06am

There's no such thing as a true "time" field in MySQL, as far as I know. There has to be a date attached to it. The date is irrelevant. I think the way SS handles time fields is just by adding hours to an arbitrary date, and in PHP that usually defaults to today.

I should revise that to only display the time and not the date as well. Surprising to me that TimeField doesn't handle that out of the box, though.

Avatar
bmc38119

Community Member, 45 Posts

15 September 2009 at 4:54am

thanks for the insight. i am so glad you could see what i was seeing. for now, i will just instruct the client to ignore that date when editing the time.

thanks for all your help.

Avatar
sajok

Community Member, 82 Posts

9 August 2010 at 5:41am

Edited: 09/08/2010 5:44am

Hi,

this thread is probably old but I have a similar problem with startTime and EndTime, and I'd like to know how you solved yours. When I add time in the format: 00h00 at the backend, the event's time fields show nothing as if nothing get saved. is it a problem with the format? if so where can I edit to add this format..

SS 2.4.1

thanks in advance.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 August 2010 at 7:06am

I can't replicate that issue. When I enter 00:00, it saves as "00:00:00". Please replicate the problem on the demo site if you can:

http://eventcalendar.bluehousegroup.com/admin
admin/password

Avatar
tuck

Community Member, 2 Posts

21 August 2011 at 1:04pm

If I wanted to get just the StartTime to show on a template in 12 hour how would I go about doing that? I have used _Times and that works but shows both Start and EndTime. If I use $StartTime then it shows it in 24 hour.

Go to Top