cutelyst/pastelyst

Dates don't appear

maidis opened this issue · 1 comments

I'm using cutelyst packages from home:buschmann23:Cutelyst:devel repository on Fedora_29 (with Turkish locale) and I'm running a copy of pastelyst on my local but creation dates of pastes don't appear:

Posted by ::1 at

After some tries, I realized that this was the cause of the date filter of Grantlee.

|date:"dd MMM yyyy, hh:mm:ss"

When I delete the above section from HTML codes, I can get dates even though it looks ugly:

Posted by ::1 at 2018-12-15T13:53:47.000

I also tried another Grantlee filter and there was no problem with it, note.created_at|lower gives expected output:

Posted by ::1 at 2018-12-15t13:53:47.000

And this is how created_at looks like at pastelyst.sqlite:

2018-12-15T13:53:30Z

What can I do to solve this situation?

This is an issue with Grantlee, I didn't even bother reporting as the maintainer shows up once in a year and mostly merge things that are in perfect shape.
The issue is that in Qt 5.7 (or 8 I think) the QDateTime::toString() added time zone information and the Grantlee date filter instead of checking if it's a QDateTime only considers the string representation thus not being able to parse it.
The workaround is to set the TZ of each QDateTime to LocalTime. I need to find some time to create a PR, poke him to merge and if this doesn't happen I'll give up and create a fork.