[pmwiki-users] Pm Calc Day

Hans design5 at softflow.co.uk
Mon Mar 26 11:25:01 CDT 2007


Monday, March 26, 2007, 4:40:01 PM, Sergio wrote:

> Hi, I get each day page the "YYYYMMDD" title, with really I hate it, more even
> beacuse I speak spanish, where/how should I (could) change in order to get
> somethihg to "25-03-07" for each day page?

You could keep using the YYYMMDD format for the page names, but use a
different title format, so it displays nice:

Nice date titles:

add to config.php or local config file:

# add PageVariable {$DMYTitle}
$FmtPV['$DMYTitle'] = 'DMYTitle($pagename)';
function DMYTitle($pagename) {
    $title = PageVar($pagename, '$Title');
    preg_match("/(\d\d\d\d)(\d\d)(\d\d)/",$pagename,$m);
    if(!$m[1]) return $title; 
    $tdate = mktime(0,0,0,$m[2],$m[3],$m[1]);
    return strftime("%d %B %Y",$tdate);
}

then put into the calendar GroupHeader page:

(:title {$DMYTitle}:)



Hans




More information about the pmwiki-users mailing list