luci-base: validation.js: fix nested function declarations
authorJo-Philipp Wich <jo@mein.io>
Thu, 11 Jul 2019 13:04:54 +0000 (15:04 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 11 Jul 2019 13:04:54 +0000 (15:04 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/validation.js

index 621e5b8bd50f1799b117edff2c9546fe143bf1eb..ca544cb15d0d71af5aa233560bf60d6821eefb76 100644 (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];
                                }