Skip to content

check-boards: show the correct format in the error message#1417

Merged
makermelissa merged 1 commit intomainfrom
explain-date-format
May 30, 2024
Merged

check-boards: show the correct format in the error message#1417
makermelissa merged 1 commit intomainfrom
explain-date-format

Conversation

@jepler
Copy link
Copy Markdown
Contributor

@jepler jepler commented May 29, 2024

The message will now say e.g.,

2021-1-21 is an invalid date for example-board. The format must be YYYY-MM-DD, using leading zeros if necessary

@jepler jepler requested a review from makermelissa May 29, 2024 21:51
@makermelissa
Copy link
Copy Markdown
Collaborator

The leading zeroes are actually optional, so the correct date format is either YYYY-M-D or YYYY-MM-DD.

@jepler
Copy link
Copy Markdown
Contributor Author

jepler commented May 30, 2024

The yaml timestamp type is documented as requiring a 4-digit year and 2-digit day/month. We previously made changes to ensure that dates are always written as YYYY-MM-DD, because of how jekyll treats front matter.

Having some dates in a different format was one of the problems with correctly ordering the RSS feed. We need to flag this as an error during our CI process, because when the incorrect format loads as a string, the ordering based on the date field is not what is intended.

Detecting the problem but not showing what format was actually required caused trouble for a contributor.

>>> import yaml
>>> yaml.safe_load('[2020-1-1, 2020-01-01]')
['2020-1-1', datetime.date(2020, 1, 1)]

Copy link
Copy Markdown
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Looks like the checks are more strict than the JavaScript.

@makermelissa makermelissa merged commit 0dd28ee into main May 30, 2024
@dhalbert dhalbert deleted the explain-date-format branch August 22, 2024 16:05
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