Skip to content

Commit

Permalink
#818 fixed reg ex to catch out of scope vars
Browse files Browse the repository at this point in the history
  • Loading branch information
david-rocca committed Jul 14, 2023
1 parent ef2e7f6 commit 23c720a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function booleanIsTrue (val) {
// Sanitizer for dates
function toDate (val) {
val = val.toUpperCase()
let value = val.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(|Z|((-|\+)\d{2}:\d{2}))$/)
let value = val.match(/^\d{4}-\d{2}-\d{2}T(?:0?[0-9]|1[0-9]|2[0-3]):(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]):(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(\.\d+)?(|Z|((-|\+)\d{2}:\d{2}))$/)
let result = null
if (value) {
const dateStr = value[0]
Expand Down

0 comments on commit 23c720a

Please sign in to comment.