]> git.mxchange.org Git - friendica.git/blobdiff - include/datetime.php
item source
[friendica.git] / include / datetime.php
index 67c4f42fad5b09219e3ebb8a6756a8233e545fe4..a5b388e767794326ee44aa894fc13561d627cbbf 100644 (file)
@@ -122,14 +122,14 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) {
        }
   
        $o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">";
-       for($x = 0; $x <= 12; $x ++) {
+       for($x = (($allow_blank) ? 0 : 1); $x <= 12; $x ++) {
                $sel = (($x == $m) ? " selected=\"selected\" " : "");
                $y = (($x) ? $x : '');
                $o .= "<option value=\"$x\" $sel>$y</option>";
        }
 
        $o .= "</select> <select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">";
-       for($x = 0; $x <= 31; $x ++) {
+       for($x = (($allow_blank) ? 0 : 1); $x <= 31; $x ++) {
                $sel = (($x == $d) ? " selected=\"selected\" " : "");
                $y = (($x) ? $x : '');
                $o .= "<option value=\"$x\" $sel>$y</option>";
@@ -276,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.
@@ -306,7 +306,7 @@ 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 = '<table class="calendar">';
+  $o = '<table class="calendar' . $class . '">';
   $o .= "<caption>$str_month $y</caption><tr>";
   for($a = 0; $a < 7; $a ++)
      $o .= '<th>' . mb_substr(day_translate($dn[$a]),0,3,'UTF-8') . '</th>';