diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-01-13 21:26:52 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-01-13 21:26:52 +0100 |
commit | 7c7ac8bf0d9d554d19f5d21226110743899b8802 (patch) | |
tree | b3fe0143ee71404435985b3333f8099041d3526a /applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js | |
parent | 25983b9fa572a640a7ecd077378df2790266cd61 (diff) |
luci-app-nlbwmon: validate date input
Fixes: #6188
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js')
-rw-r--r-- | applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js index 3f0a4c969f..bdebf296ea 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js @@ -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'); |