public function iCalDateToUnixTimestamp($icalDate)
{
$zulu = false;
- if ( strpos( $icalDate, 'Z' ) ) {
+ if ( strpos( $icalDate, 'Z' ) && preg_match( '%Z$%', $icalDate ) ) {
$zulu = true;
}
$icalDate = str_replace('T', '', $icalDate);
}
if ( $btime && $etime && $etime === '00:00' ) {
$start_time_only = true;
+ // If the end time is 00:00 then take one away from the end
+ // date if needed.
+ if ( $to_date != $from_date ) {
+ $toDate = date_create( $to_date );
+ $toDate = date_modify( $toDate, '-1 day' );
+ $to_date = date_format( $toDate, 'Y-m-d' );
+ }
}
// for the recurrences part
$recur_data = array(
'last_day_of_month' => $last_day_of_month,
'specific_dates' => $serialized_times
);
+ if ( $debug ) {
+ $out .= '<pre>$recur_data: ' . print_r( $recur_data, true ) . '</pre>';
+ }
$this->wpdb->insert(
GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'recurrences',
$recur_data,