-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Invalid Date format #413
Comments
Where did this date format come from? It’s not a valid YAML or UTC String? |
According to https://yaml.org/type/timestamp.html:
|
Oh interesting. Are you sure those aren’t accidentally strings? Doesn’t look like YAML tries to parse them at all, as that error comes from a fallback condition where Luxon tries to parse the date string: https://github.com/11ty/eleventy/blob/master/src/Template.js#L613 |
Can you attach an example of the front matter that’s failing? |
Here is an example of a Forestry output, leading to the same error: ---
subtitle: New doc page
date: 2019-03-13 20:18:42 +0000
tags:
- docs
--- |
Alright I dove in a bit deeper on this and I think it’s a js-yaml bug. We use gray-matter which uses js-yaml. They have a live demo here: https://nodeca.github.io/js-yaml/ Your example returns a string. The following formats do work: For comparison YAMLlint thinks your date format is valid, albeit it corrects the formatting by adding a colon to Can you file this upstream and provide a link back? https://github.com/nodeca/js-yaml |
Also note that in the discussion above “a more relaxed format is also supported for enhanced readability, using white space separation” refers to the whitespace between the time and the time zone, not whitespace between the timezone hours and timezone minutes.
Sorry 😲 |
Worth noting that feature request #335 may give you an easier out here? Not sure. Might let you avoid having to update all of your data. |
Hello, I run into the same trouble,
What is wrong with the formatter? |
According to https://www.11ty.io/docs/dates/, it's not valid. 😞
That means I have to change the date of all my existing posts?
The text was updated successfully, but these errors were encountered: