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 - Get Start Date of event for registration form


Go to End


1535 Views

Avatar
smallstudio

Community Member, 7 Posts

14 February 2011 at 8:16pm

Hey there, I have a site with an old calendar module that I've updated with the Event Calendar module. There is an established booking process that works fine for the client, but I'll be damned if I can get the actual date to pass from the event page to the booking form. All other data is being passed. For example:

$date = date ('d/m/Y', strtotime($event->StartDate));

$fields = new FieldSet(
new LiteralField("Title", '<h2>'.$event->Title . '</h2>' . '$' . $event->TicketCost . ' : ' . $date . ' : ' . $event->Category),
....etc

$event->Title shows, as does $event->TicketCost and $event->$Category

Is there a standard StartDate field that can be grabbed from the CalendarEvent or CalendarDateTime class? All I need is the start date of the first date (there will only be one date and time for any given event).

I have a feeling this is a total rookie error, but any help is greatly appreciated!