This fix date and time pattern validation issues (#1547)

This commit is contained in:
joehan109 2023-05-27 00:22:35 +08:00 committed by GitHub
parent 76cd0992b0
commit 16efeae5b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1049,7 +1049,7 @@ func (f *File) checkDateTimePattern() error {
p := nfp.NumberFormatParser() p := nfp.NumberFormatParser()
for _, section := range p.Parse(pattern) { for _, section := range p.Parse(pattern) {
for _, token := range section.Items { for _, token := range section.Items {
if inStrSlice(supportedNumberTokenTypes, token.TType, false) == -1 || inStrSlice(supportedNumberTokenTypes, token.TType, false) != -1 { if inStrSlice(supportedTokenTypes, token.TType, false) == -1 || inStrSlice(supportedNumberTokenTypes, token.TType, false) != -1 {
return ErrUnsupportedNumberFormat return ErrUnsupportedNumberFormat
} }
} }