luci-base: validation.js: fix nested function declarations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-07-11 15:04:54 +02:00
parent 43043a46a3
commit a7bfaf9b0b

View file

@ -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];
}