From a7bfaf9b0b2a36c72055e0e23feba193af50e1c9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 11 Jul 2019 15:04:54 +0200 Subject: luci-base: validation.js: fix nested function declarations Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/validation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index 621e5b8bd..ca544cb15 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -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]; } -- cgit v1.2.3