diff options
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 6 | ||||
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/validation.js | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index b66fe684a5..22cbecc864 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -614,17 +614,17 @@ String.prototype.format = function() var tm = 0; var ts = (param || 0); - if (ts > 60) { + if (ts > 59) { tm = Math.floor(ts / 60); ts = (ts % 60); } - if (tm > 60) { + if (tm > 59) { th = Math.floor(tm / 60); tm = (tm % 60); } - if (th > 24) { + if (th > 23) { td = Math.floor(th / 24); th = (th % 24); } diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js index 28042ba8cd..70d3a7e73a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/validation.js +++ b/modules/luci-base/htdocs/luci-static/resources/validation.js @@ -338,9 +338,10 @@ var ValidatorFactory = baseclass.extend({ return this.assert(this.apply('port'), _('valid port or port range (port1-port2)')); }, - macaddr: function() { - return this.assert(this.value.match(/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/) != null, - _('valid MAC address')); + macaddr: function(multicast) { + var m = this.value.match(/^([a-fA-F0-9]{2}):([a-fA-F0-9]{2}:){4}[a-fA-F0-9]{2}$/); + return this.assert(m != null && !(+m[1] & 1) == !multicast, + multicast ? _('valid multicast MAC address') : _('valid MAC address')); }, host: function(ipv4only) { |