luci-app-nlbwmon: validate date input
Fixes: #6188 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
25983b9fa5
commit
7c7ac8bf0d
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue