11
@jjdai,
The calendar js file does not support php date formats. It uses dd-mm-yy and other formats that can not be translated with php strtotime().
This was fixed on XOOPS 2.5.4, calendar js was changed to accept Y,y,m,n,j,d date elements instead.
In extcal/class/event.php you will have to use this:
function _checkDate(&$data)
{
$data['event_start'] = strtotime($data['event_start']['date']) + $data['event_start']['time'];
$data['event_end'] = strtotime($data['event_end']['date']) + $data['event_end']['time'];
if ($data['have_end'] == 0 || $data['event_start'] > $data['event_end']
) {
$data['event_end'] = $data['event_start'];
}
}
And in getRecurRules() under case Yearly
case 'yearly':
if ($parm['rrule_yearly_byday'] == "") {
$time = strtotime($parm['event_start']['date']);
$parm['rrule_yearly_byday'] = date("j", mktime(0, 0, 0, date("m", $time), date("d", $time), date("Y", $time)));
}
$recurRules = 'yearly|';
$recurRules .= $parm['rrule_yearly_interval'];
$recurRules .= '|' . $parm['rrule_yearly_byday'];
foreach (
$parm['rrule_yearly_bymonths'] as $month
) {
$recurRules .= '|' . $month;
}
break;
}
The value that comes from post can be used directly on strtotime() without problems.
Don't forget to remove every check for "invalid format date". They wont be necessary. '/' and '-' are valid separators.