function form_date_dropdowns($year = 0, $month = 0, $day = 0, $prefix = false, $start_year = 0) { // the end of 2037 is more or less the maximum time that // can be represented as a UNIX timestamp currently if (is_numeric($start_year) && $start_year > 0 && $start_year < 2037) { $years = array(' ') + range_keys($start_year, 2037); } else { $years = array(' ') + range_keys(date('Y', time()), 2037); } $days = array_merge(array(' '), range(1, 31)); $months = array_merge(array(' '), lang_get_month_names()); $output = form_dropdown_array("{$prefix}day", $days, $day) . " "; $output .= form_dropdown_array("{$prefix}month", $months, $month) . " "; $output .= form_dropdown_array("{$prefix}year", $years, $year) . " "; return $output; }
function light_form_dob_dropdowns($dob_year, $dob_month, $dob_day, $show_blank = true, $custom_html = null) { if ($show_blank) { $birthday_days = array_merge(array(' '), range(1, 31)); $birthday_months = array_merge(array(' '), lang_get_month_names()); $birthday_years = array(' ') + range_keys(1900, date('Y', time())); } else { $birthday_days = range_keys(1, 31); $birthday_months = lang_get_month_names(); $birthday_years = range_keys(1900, date('Y', time())); } $output = light_form_dropdown_array("dob_day", $birthday_days, $dob_day, $custom_html) . " "; $output .= light_form_dropdown_array("dob_month", $birthday_months, $dob_month, $custom_html) . " "; $output .= light_form_dropdown_array("dob_year", $birthday_years, $dob_year, $custom_html) . " "; return $output; }