✨ Use ParseDate in Parse
Also limit to English, or we get lots of false positives
This commit is contained in:
parent
391452e3d9
commit
96c3b2ff30
3 changed files with 7 additions and 4 deletions
|
|
@ -5,7 +5,6 @@ import (
|
|||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func ParseBytes(in []byte) any {
|
||||
|
|
@ -34,7 +33,7 @@ func ParseString(in string) any {
|
|||
return i
|
||||
} else if f, err := strconv.ParseFloat(s, 64); err == nil {
|
||||
return f
|
||||
} else if t, err := time.Parse(time.RFC3339, s); err == nil {
|
||||
} else if t, err := ParseDate(s); err == nil {
|
||||
return t
|
||||
} else if err := json.Unmarshal([]byte(s), &j); err == nil {
|
||||
return j
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue