Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datetest appears to accept nonsense when using --isvalid #146

Open
Earnestly opened this issue Jul 28, 2022 · 1 comment
Open

datetest appears to accept nonsense when using --isvalid #146

Earnestly opened this issue Jul 28, 2022 · 1 comment

Comments

@Earnestly
Copy link

datetest --isvalid -i %FT%T -i %F -- 2022-02-27 # Okay
datetest --isvalid -i %FT%T -i %F -- 2022-02-27T # Should fail
datetest --isvalid -i %FT%T -i %F -- 2022-02-27T9999:8888:7777 # Should definately fail

It seems that if 2022-02-27 is matched, anything after it is also accepted.

Is there a proper way to have datetest check the validity of an input based on multiple formats (i.e. a subset of ISO8601 or RFC3339)?

hroptatyr added a commit that referenced this issue Jul 29, 2022
* bug/146:
  fix, be strict in dateset --isvalid when input formats are present, fixes issue #146
  test, add regression cases
@hroptatyr
Copy link
Owner

Hi,
thanks for the report, good catch. Fix is in 06198a8.

GerHobbelt added a commit to GerHobbelt/dateutils that referenced this issue May 10, 2024
Summary: v0.4.11 of dateutils
Keywords: v0.4.11

This is dateutils v0.4.11.

This is a bugfix release.

Bugfixes:
- be strict about inputs in datetest --isvalid (hroptatyr#146)
- build on Macs again (hroptatyr#107)
- make illegible zone names fatal errors (hroptatyr#151)
- be strict in datetest --isvalid when inputs have been specified (hroptatyr#146)
- fix issue with negative days remaining after adding months in datediff (hroptatyr#153)

See info page examples and/or README.

# -----BEGIN PGP SIGNATURE-----
# Version: GnuPG v2
#
# iEYEABECAAYFAmWyMssACgkQlMmhrILJOQ4F0wCfbiWQfuERz79Mq+BNlyOw0tL6
# RkoAoItx9dPdr/1inKBukpq2McZK2QrF
# =upNa
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Jan 25 11:07:07 2024 WEST
# gpg:                using DSA key 94C9A1AC82C9390E
# gpg: Can't check signature: No public key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants