aboutsummaryrefslogtreecommitdiffstats
path: root/include/datetime.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-10 07:09:57 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-10 07:09:57 -0700
commit44b19841360099cc3e78d1a3612f7aa23e2e6524 (patch)
treec6a9c69e6271862a4a8710ebddc6d8a0d6e76baa /include/datetime.php
parent970a2d4f1ef03f696a5b321bf0d7034d9e8cfe3f (diff)
downloadvolse-hubzilla-44b19841360099cc3e78d1a3612f7aa23e2e6524.tar.gz
volse-hubzilla-44b19841360099cc3e78d1a3612f7aa23e2e6524.tar.bz2
volse-hubzilla-44b19841360099cc3e78d1a3612f7aa23e2e6524.zip
profile additions
Diffstat (limited to 'include/datetime.php')
-rw-r--r--include/datetime.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/include/datetime.php b/include/datetime.php
index 0beadbe78..540c43691 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -60,7 +60,12 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d
return($d->format($fmt));
}}
-
+function dob($dob) {
+ list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d');
+ $y = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
+ $o = datesel('',1920,$y,true,$year,$month,$day);
+ return $o;
+}
if(! function_exists('datesel')) {
function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) {
@@ -68,25 +73,27 @@ function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) {
$o = '';
$o .= "<select name=\"{$pre}year\" class=\"{$pre}year\" size=\"1\">";
if($allow_blank) {
- $sel = (($y == '') ? " selected=\"selected\" " : "");
- $o .= "<option value=\"\" $sel></option>";
+ $sel = (($y == '0000') ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"0000\" $sel ></option>";
}
- for($x = $ymin; $x <= $ymax; $x ++) {
+ 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\">";
- for($x = 1; $x <= 12; $x ++) {
+ $o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">";
+ for($x = 0; $x <= 12; $x ++) {
$sel = (($x == $m) ? " selected=\"selected\" " : "");
- $o .= "<option value=\"$x\" $sel>$x</option>";
+ $y = (($x) ? $x : '');
+ $o .= "<option value=\"$x\" $sel>$y</option>";
}
- $o .= "</select>-<select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">";
- for($x = 1; $x <= 31; $x ++) {
+ $o .= "</select> <select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">";
+ for($x = 0; $x <= 31; $x ++) {
$sel = (($x == $d) ? " selected=\"selected\" " : "");
- $o .= "<option value=\"$x\" $sel>$x</option>";
+ $y = (($x) ? $x : '');
+ $o .= "<option value=\"$x\" $sel>$y</option>";
}
$o .= "</select>";