mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix start_year and end_year of {html_select_date} did not use current year as offset base (Issue #53)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
===== trunk =====
|
||||
06.10.2011
|
||||
- bugfix switch lexer internals depending on mbstring.func_overload
|
||||
- bugfix start_year and end_year of {html_select_date} did not use current year as offset base (Issue #53)
|
||||
|
||||
05.10.2011
|
||||
- bugfix of problem introduced with r4342 by replacing strlen() with isset()
|
||||
|
@@ -55,7 +55,9 @@ function smarty_function_html_select_date($params, $template)
|
||||
{
|
||||
// generate timestamps used for month names only
|
||||
static $_month_timestamps = null;
|
||||
static $_current_year = null;
|
||||
if ($_month_timestamps === null) {
|
||||
$_current_year = date('Y');
|
||||
$_month_timestamps = array();
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$_month_timestamps[$i] = mktime(0, 0, 0, $i, 1, 2000);
|
||||
@@ -211,11 +213,11 @@ function smarty_function_html_select_date($params, $template)
|
||||
$key .= '_year';
|
||||
$t = $$key;
|
||||
if ($t === null) {
|
||||
$$key = (int)$_year;
|
||||
$$key = (int)$_current_year;
|
||||
} else if ($t[0] == '+') {
|
||||
$$key = (int)($_year + trim(substr($t, 1)));
|
||||
$$key = (int)($_current_year + trim(substr($t, 1)));
|
||||
} else if ($t[0] == '-') {
|
||||
$$key = (int)($_year - trim(substr($t, 1)));
|
||||
$$key = (int)($_current_year - trim(substr($t, 1)));
|
||||
} else {
|
||||
$$key = (int)$$key;
|
||||
}
|
||||
|
Reference in New Issue
Block a user