date widget can now prefix (readonly) dates with the week-number

This commit is contained in:
Ralf Becker 2007-03-09 11:23:26 +00:00
parent dcc669af74
commit 41a7e43d1b
2 changed files with 7 additions and 1 deletions

View File

@ -672,7 +672,8 @@ implement only a subset of XUL. Here are the main differences:</p>
the up-to-date date (via javascript)<br />
<b>one-min-steps</b>: if set (&4) the minute-selectbox uses one minutes steps, default 5min steps<br />
<b>ro-suppress-0h0</b>: if set (&8) the time is suppressed for readonly and a time of 0h0<br />
<b>day-of-week-prefix</b>: if set (&16) readonly dates get prefixed with the day of week
<b>day-of-week-prefix</b>: if set (&16) readonly dates get prefixed with the day of week<br />
<b>week-number-prefix</b>: if set (&32) readonly dates get prefixed with lang('Wk') & weeknumber<br />
<b>Sub-widgets</b>: <b>date-time</b>: a date and a time and <b>date-timeonly</b> or <b>date-houronly</b>: only a time / hour<br />
These widgets allow the input of times too or only, they use 12h am/pm or 24h format as
specified in the user prefs.<br />

View File

@ -20,6 +20,7 @@
* &4 = 1min steps for time (default is 5min, with fallback to 1min if value is not in 5min-steps),
* &8 = dont show time for readonly and type date-time if time is 0:00,
* &16 = prefix r/o display with dow
* &32 = prefix r/o display with week-number
*
* This widget is independent of the UI as it only uses etemplate-widgets and has therefor no render-function.
* Uses the adodb datelibary to overcome the windows-limitation to not allow dates before 1970
@ -183,6 +184,10 @@
{
$str = lang(adodb_date('l',adodb_mktime(12,0,0,$value['m'],$value['d'],$value['Y']))).' ';
}
if (!$n && $options & 32 )
{
$str = lang('Wk').adodb_date('W',adodb_mktime(12,0,0,$value['m'],$value['d'],$value['Y'])).' ';
}
$str .= ($str != '' ? $sep[$n] : '') .
(is_numeric($value[$format[$n]]) ? sprintf('%02d',$value[$format[$n]]) : $value[$format[$n]]);
}