[Pmwiki-users] Calendar display - can't change format
John Rankin
john.rankin
Tue Nov 23 13:11:25 CST 2004
On Wednesday, 24 November 2004 2:39 AM, Richard Geoffrion <pmwiki at rain4us.net> wrote:
>No matter what I try, I can't get the WikiLog calendar to change the way it
>formats its date.
>
>The format is always
>MM.DD.YYYY and the day_of_week always begins on Monday.
>
>This is a snippet from my config.php where I believe I've told the calendar
>that I want to start the week on Sunday, use the American date style, have
>four months displayed in two rows of two...and one other option. The
>problem is, nothing seems to work even though I've put these overrides in
>the local/config.php.
>
>[snippet]
>include_once("local/wikilog.php");
>SDV($calendar_weekstyle,0);
>SDV($calendar_datestyle,1);
>SDV($calendar_months_number,4);
>SDV($calendar_month_wrap,2);
>SDV($summary_only,false);
>[/snippet]
>
>--
>Richard
>
The reason is in the way PmWiki's SDV function works. Short answer:
Try
SDV($calendar_weekstyle,0);
SDV($calendar_datestyle,1);
SDV($calendar_months_number,4);
SDV($calendar_month_wrap,2);
SDV($summary_only,false);
include_once("local/wikilog.php");
That is, move the include *after* the SDV settings.
Longer answer:
The SDV function looks to see if the variable being set already
has a value. If it does, the value is unchanged. So, wikilog.php
sets its defaults using SDV; thus if an administrator writes
$calendar_weekstyle = 0;
include_once("local/wikilog.php");
the local setting will over-ride the default. Similarly, an
administrator can write
include_once("local/wikilog.php");
$calendar_weekstyle = 0;
and again the local setting over-rides the default value.
In general (this is not always possible, but it's a good
rule of thumb), cookbook scripts use SDV to set default
values and local/config.php scripts use $v = 'value';
assignments.
I will update the calendar page to clarify this. Thanks for
pointing it out.
--
JR
--
John Rankin
More information about the pmwiki-users
mailing list