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 .= "