diff options
author | Friendika <info@friendika.com> | 2011-06-06 19:59:20 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-06 19:59:20 -0700 |
commit | 452245d9883c29640fb1bd3a9e0d7cefaed77f23 (patch) | |
tree | 22a9f019beec486eda510b21cbe3430b5826845d /include/datetime.php | |
parent | c0094aa4f865defe8be63963b32f69d05e258f48 (diff) | |
download | volse-hubzilla-452245d9883c29640fb1bd3a9e0d7cefaed77f23.tar.gz volse-hubzilla-452245d9883c29640fb1bd3a9e0d7cefaed77f23.tar.bz2 volse-hubzilla-452245d9883c29640fb1bd3a9e0d7cefaed77f23.zip |
more events framework
Diffstat (limited to 'include/datetime.php')
-rw-r--r-- | include/datetime.php | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/include/datetime.php b/include/datetime.php index f7be5bdb1..67c4f42fa 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -108,9 +108,17 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) { $o .= "<option value=\"0000\" $sel ></option>"; } - for($x = $ymax; $x >= $ymin; $x --) { - $sel = (($x == $y) ? " selected=\"selected\" " : ""); - $o .= "<option value=\"$x\" $sel>$x</option>"; + if($ymax > $ymin) { + for($x = $ymax; $x >= $ymin; $x --) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } + } + else { + for($x = $ymax; $x <= $ymin; $x ++) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } } $o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">"; @@ -131,6 +139,32 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) { return $o; }} +if(! function_exists('timesel')) { +function timesel($pre,$h,$m) { + + $o = ''; + $o .= "<select name=\"{$pre}hour\" class=\"{$pre}hour\" size=\"1\">"; + for($x = 0; $x < 24; $x ++) { + $sel = (($x == $h) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } + $o .= "</select> : <select name=\"{$pre}minute\" class=\"{$pre}minute\" size=\"1\">"; + for($x = 0; $x < 60; $x ++) { + $sel = (($x == $m) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } + + $o .= "</select>"; + return $o; +}} + + + + + + + + // implements "3 seconds ago" etc. // based on $posted_date, (UTC). // Results relative to current timezone |