-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
weird display of date #699
Comments
Check the |
Thanks a lot for the answer. I did put the timezone in I can't really use I doesn't work any better with |
The Pico doesn't parse the Thus, please try adding a timezone to your YAML headers, like: date: 2024-05-05 18:30:00+02:00 |
I assume this to be pretty unexpected. We should probably overrule the YAML specs here and use the A few notes for a possible future fix: The current Symfony YAML version returns just a timestamp (timezone-independent by design), but newer Symfony YAML releases allow returning a |
Thank you so much. Following your suggestion, I added the timezone directly to the YAML headers, and it works perfectly. Your explanations are very clear. I was initially confused because I had previously used the CMS Stacey, where such specification wasn't necessary. I switched to Pico due to the PHP 8 compatibility of its fork. Once again, thank you. I'll stick with my template-side fix. I've heard that Pico has been sold and that the new owner isn't responding to commits. Is that correct? Is it possible that they acquired it with the intention to shut it down? |
Let's keep this open since it's a unfixed bug 👍
Gilbert, the original author, sold the project a very long time ago to Greg, the current owner. AFAIK Greg is no PHP developer, he just owns the project. I took over development some years ago and basically rewrote it from scratch while keeping Gilbert's base concept, mostly because I was using it myself. However, I no longer have the time (nor will tbh...) to work on Pico. I still provide some basic support for the remaining users though... Since nobody else wanted to take over responsibility yet, Pico is basically abandoned from a development perspective. However, I believe that if someone wants to take responsibility, one could still get write access, just as I did years ago. I'm not aware of any plans to shut it down. |
TLDR: to keep your Date in your Timezone put it in Brackets, to be parsed as String not as DateTime in UTC. The YML parsing works according to the Specs. The YAML Specs ( Example: 2.22) allow following input: Source: #https://yaml.org/spec/1.2.2/ See also the Discussion in: symfony/symfony#26607 (comment) So, it's not a Bug, it's a feature ;-) |
THANK YOU SO MUCH |
Hello
I'm new to Pico, working on a website with it and I got to love this ultra-light cms very quickly.
Since I need PHP 8 for other needs I run the 3.0.0-alpha.2
Everything works fine except one very annoying thing :
When a YAML file contains a date, for example :
date: 2024-05-05 18:30:00
And when I tried to display it in a template, whether with a date filter or not :
{{ post.date|date("m/d/Y H:i") }}
or{{ post.date }}
it returns an UTC time instead of the right time of my timezone. In this case it will display:
2024-05-05 20:30:00
instead of2024-05-05 18:30:00
I checked that my config is set to Europe/Paris and when I tried to display
{{ "now"|date("m/d/Y H:i") }}
it returns the correct time.I searched for hours a solution to this problem and couldn't find it.
So I had to patch my template with something like
{% set adjustedDate = post.date|date_modify('-2 hours') %}
to get the correct time.Any idea where does it come from?
Besides, so sad that PicoCMS is abandonned. I tried many flat file cms and this one is really the lightest and the best for my needs.
Thanks a lot if anyone reads me.
The text was updated successfully, but these errors were encountered: