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

Implemented a better date conversion for 'date:' and 'modified:' fields. #297

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

aviaconstructor
Copy link

This PR fixes the following bad dates that were accepted previously:

  • date: 01-01-24 was accepted as 0001-01-24
  • date: 24-01-24 was accepted as 0024-01-24

These will result in an error now.

Recently in 300d61e the US-style dates were eliminated. Unfortunately, these are still very much used. I propose we continue supporting such dates, but we only accept unambiguous forms.

Therefore, this commit implements and tests the dates of the following formats:

  • XXXX-XX-XX -- fully corresponds to yaml date format
  • XXXX/XX/XX, XXXX/XX/X, XXXX/X/XX, XXXX/X/X -- legacy, often occurs in (old) US-based sigmas

aviaconstructor added 2 commits October 25, 2024 20:27
This PR fixes the following bad dates that were accepted previously:
  *  date: 01-01-24 was accepted as 0001-01-24
  *  date: 24-01-24 was accepted as 0024-01-24

These will result in an error now.

Recently in 300d61e the US-style dates
were eliminated. Unfortunately, these are still very much used.
I propose we continue supporting such dates, but we only accept unambiguous forms.

Therefore, this commit implements and tests the dates of the following formats:
   * XXXX-XX-XX   -- fully corresponds to yaml date format
   * XXXX/XX/XX, XXXX/XX/X, XXXX/X/XX, XXXX/X/X -- legacy, often occurs in (old) US-based sigmas
@thomaspatzke thomaspatzke merged commit ad6f3c3 into SigmaHQ:main Nov 3, 2024
15 checks passed
@thomaspatzke
Copy link
Member

Nice, thanks!

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

Successfully merging this pull request may close these issues.

2 participants