format($param); break; // No arguments case 'getdate' : case 'time' : case 'timezone_identifiers_list' : $result = $function(); break; // One argument - $data case 'date' : case 'date_parse' : case 'strtotime' : case 'date_interval_create_from_date_string' : case 'date_offset_get' : $result = $function($data); break; // Two arguments - data, parameter case 'date_add' : case 'date_sub' : case 'date_format' : case 'date_modify' : case 'date_diff' : case 'date_interval_format' : $result = $function($data, $param); break; // Second argument as date case 'date_create_from_format' : case 'date_parse_from_format' : $result = $function($param, $data); break; // JOOMLA METHODS // No parameters case 'toISO8601' : case 'toRFC822' : case 'toUnix' : case 'toSql' : $date = Factory::getDate($data); $result = $date->$function(); break; // One parameter case 'format' : case 'modify' : $date = Factory::getDate($data); $result = $date->$function($param); break; } return $result; } /* DATE INTERVALS P1D / 1 day P2W / 2 weeks P3M / 3 months P4Y / 4 years P1Y1D / 1 year + 1 day P1YT12H / 1 year + 12 hours PT3600S / 3600 seconds */ }