You are not logged in.
Pages: 1
Hello,
I think I found a very small bug in the the Events extension. The formattedTime function in events.php was not working for me and I looked at the code for the function and it was looking for $item["start"] and $item["end"] on lines 249 and 250 in events.php and when I changed it to $item["start_time"] and $item["end_time"] the times are showing.
File location: com.fastspot.events > classes > events.php
static function formattedTime($item,$time_format = "gi:a") {
$s = strtotime($item["start"]);
$e = strtotime($item["end"]);
if ($item["all_day"]) {
return "All Day";
}
if ($s != $e && $item["end_time"] != "") {
return date($time_format,$s)." - ".date($time_format,$e);
} else {
return date($time_format,$s);
}
}
Should be
static function formattedTime($item,$time_format = "gi:a") {
$s = strtotime($item["start_time"]);
$e = strtotime($item["end_time"]);
if ($item["all_day"]) {
return "All Day";
}
if ($s != $e && $item["end_time"] != "") {
return date($time_format,$s)." - ".date($time_format,$e);
} else {
return date($time_format,$s);
}
}
Offline
"start" and "end" are columns that come from the btx_events_date_cache table -- they refer to the particular instance of an event. If you're passing an event row directly from btx_events_events then you'll need to switch to start_time and end_time which should work just as well - I can't think of any reason they wouldn't in the current iteration of the Events module.
Some customized versions of the Events module allow for instances to be manually generated (e.g. an Event on Tuesday at 3pm and on Thursday at 6pm) and I think that's the reason behind using start/end.
Offline
Thanks Tim for clarifying this up for me.
Offline
Pages: 1