fix typos

This commit is contained in:
Pavol Rusnak 2011-11-08 15:39:07 +01:00
parent 2193a54755
commit cafd14a45b

View file

@ -27,15 +27,15 @@ class syntax_plugin_nextday extends DokuWiki_Syntax_Plugin {
$day = NULL; $day = NULL;
if (count($in) == 1) { if (count($in) == 1) {
if (in_array($in[0], array('mon','tue','wed','thu','fri','sat','sun'))) { if (in_array($in[0], array('mon','tue','wed','thu','fri','sat','sun'))) {
$day = strtotime('next ' . $match, strtotime('yesterday')); $day = strtotime('next ' . $in[0], strtotime('yesterday'));
} }
} else if (count($in) == 2) { } else if (count($in) == 2) {
if (in_array($in[0], array('first','second','third','fourth','fifth','last')) && if (in_array($in[0], array('first','second','third','fourth','fifth','last')) &&
in_array($in[1], array('mon','tue','wed','thu','fri','sat','sun'))) { in_array($in[1], array('mon','tue','wed','thu','fri','sat','sun'))) {
$day_today = strtotime('today'); $day_today = strtotime('today');
$day_next = strtotime("{$in[0]} {$in[1]} of next month"); $day_next = strtotime("${in[0]} ${in[1]} of next month");
$day_this = strtotime("{$in[0]} {$in[1]} of this month"); $day_this = strtotime("${in[0]} ${in[1]} of this month");
$day = $date_this < $date_today ? $date_next : $date_this; $day = ($day_this < $day_today) ? $day_next : $day_this;
} }
} }
return $day ? strftime('%d %B %Y', $day) : ''; return $day ? strftime('%d %B %Y', $day) : '';