Perlkonig / grav-skeleton-knowledge-base

Skeleton package of the Knowledge Base theme for Grav CMS
https://www.perlkonig.com/knowledge-base
MIT License
22 stars 14 forks source link

Bad date formats bring down the entire site #14

Closed axcodeplex closed 6 years ago

axcodeplex commented 6 years ago

Creating an item.md like this:


title: New Content Example date: 08-21-2018 taxonomy: category: [New Category 42] tag: [] author: Foo

Note the reversal of the month/day. The format above will bring the site down with the following error:

Server Error Sorry, something went terribly wrong! 0 - DateTime::__construct(): Failed to parse time string (08-21-2018) at position 0 (0): Unexpected character

Perlkonig commented 6 years ago

This isn't an issue with the theme but with Grav itself. If you change the dashes to slashes, it works fine. Here's the doc page that talks about it. I agree that Grav should handle unambiguous cases like this more gracefully. Maybe I'll see if I can do a PR.

axcodeplex commented 6 years ago

Ah good call, missed that, sorry. Keep up the good work!