X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdatetime.php;h=a5b388e767794326ee44aa894fc13561d627cbbf;hb=55112cfdd0dc63c8ad7f719aea5b46db37fcf081;hp=724eec9336c9c379f3c464253ba77766a044b1c5;hpb=a5b80e5d564f6c239510dbee10daf3ff4c314f2e;p=friendica.git diff --git a/include/datetime.php b/include/datetime.php index 724eec9336..a5b388e767 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -108,20 +108,28 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) { $o .= ""; } - for($x = $ymax; $x >= $ymin; $x --) { - $sel = (($x == $y) ? " selected=\"selected\" " : ""); - $o .= ""; + if($ymax > $ymin) { + for($x = $ymax; $x >= $ymin; $x --) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= ""; + } + } + else { + for($x = $ymax; $x <= $ymin; $x ++) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= ""; + } } $o .= " "; + for($x = 0; $x < 24; $x ++) { + $sel = (($x == $h) ? " selected=\"selected\" " : ""); + $o .= ""; + } + $o .= " : "; + return $o; +}} + + + + + + + + // implements "3 seconds ago" etc. // based on $posted_date, (UTC). // Results relative to current timezone @@ -242,7 +276,7 @@ function get_first_dim($y,$m) { if(! function_exists('cal')) { -function cal($y = 0,$m = 0, $links = false) { +function cal($y = 0,$m = 0, $links = false, $class='') { // month table - start at 1 to match human usage. @@ -272,10 +306,10 @@ function cal($y = 0,$m = 0, $links = false) { $tddate = intval(datetime_convert('UTC',date_default_timezone_get(),'now','j')); $str_month = day_translate($mtab[$m]); - $o = ''; + $o = '
'; $o .= ""; for($a = 0; $a < 7; $a ++) - $o .= ''; + $o .= ''; $o .= ''; while($d <= $l) {
$str_month $y
' . substr(day_translate($dn[$a]),0,3) . '' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '