luci-app-nlbwmon: validate date input
Fixes: #6188 Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 7c7ac8bf0d9d554d19f5d21226110743899b8802)
This commit is contained in:
parent
749268a2ca
commit
bb1e09eb50
@ -102,6 +102,9 @@ return view.extend({
|
||||
|
||||
return m ? m[1] : null;
|
||||
};
|
||||
o.validate = function(section_id, value) {
|
||||
return /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.exec(value) ? true : _('Require a valid date in the form "YYYY-MM-DD"');
|
||||
};
|
||||
o.write = writePeriod;
|
||||
o.depends('_period', 'absolute');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user