luci-base: validation.js: fix nested function declarations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
43043a46a3
commit
a7bfaf9b0b
1 changed files with 2 additions and 2 deletions
|
@ -510,11 +510,11 @@ var ValidatorFactory = L.Class.extend({
|
|||
day = +RegExp.$3,
|
||||
days_in_month = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
|
||||
|
||||
function is_leap_year(year) {
|
||||
var is_leap_year = function(year) {
|
||||
return ((!(year % 4) && (year % 100)) || !(year % 400));
|
||||
}
|
||||
|
||||
function get_days_in_month(month, year) {
|
||||
var get_days_in_month = function(month, year) {
|
||||
return (month === 2 && is_leap_year(year)) ? 29 : days_in_month[month - 1];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue