The todo plugin doesn't use the Date format set by strftime so if you want to use a date format other than yyyy/mm/dd
you'll have to make some modifications.
Note that these modification will not survive updates.
Rather than doing this customization, just add a pull request to the github repo, either add date format as a config option or update code to use dokuwikisdformat
config option — Christian Marg 2020-02-06 16:20
Example:- Change to the Australian date format (dd/mm/yyyy)
$newTag = preg_replace('/>/', ' #'.$user.':'.date('Y-m-d').'>', $todoTag)
to
$newTag = preg_replace('/>/', ' #'.$user.':'.date('d-m-Y').'>', $todoTag)
if(date('Y-m-d', strtotime($completeddate)) == $completeddate) {
to
if(date('d-m-Y', strtotime($completeddate)) == $completeddate) {
, change
case 'start': if(date('Y-m-d', strtotime($value)) == $value) {
to
case 'start': if(date('d-m-Y', strtotime($value)) == $value) {
, and change
case 'due': if(date('Y-m-d', strtotime($value)) == $value) {
to
case 'due': if(date('Y-m-d', strtotime($value)) == $value) {
and change
if(isset($data['start'])) { $return .= $data['start']->format('Y-m-d'); } $return .= ' → '; if(isset($data['due'])) { $return .= $data['due']->format('d-m-Y'); }
to
if(isset($data['start'])) { $return .= $data['start']->format('d-m-Y'); } $return .= ' → '; if(isset($data['due'])) { $return .= $data['due']->format('d-m-Y'); }
if(date('Y-m-d', strtotime($date)) == $date) { $result[0] = $date; } elseif(preg_match('/^[\+\-]\d+$/', $date)) { // check if we have a valid relative va$ $newdate = date_create(date('Y-m-d')); date_modify($newdate, $date . ' day'); $result[0] = date_format($newdate, 'Y-m-d'); } else { $result[0] = date('Y-m-d'); } } } else { $result[0] = date('Y-m-d'); }
to
if(date('d-m-Y', strtotime($date)) == $date) { $result[0] = $date; } elseif(preg_match('/^[\+\-]\d+$/', $date)) { // check if we have a valid relative va$ $newdate = date_create(date('d-m-Y')); date_modify($newdate, $date . ' day'); $result[0] = date_format($newdate, 'd-m-Y'); } else { $result[0] = date('d-m-Y'); } } } else { $result[0] = date('d-m-Y'); }
— SFITCS 2017-03-17 12:10