dropplets icon indicating copy to clipboard operation
dropplets copied to clipboard

Wrong Ordering with non-compliant date

Open Hibby opened this issue 13 years ago • 7 comments

Posting last night, I noticed that if I use the date format 2013-09-2, Dropplets doesn't parse the date correctly, and displays posts out of (chronological) order.

Changing the date to 2013-09-02 solved the problem. Perhaps we could look into adding slight changes to the way the date is read to fix for lazy folks (like I can be)?

While I'm happy to remember to fix my dates and be less lazy, others might not be.

Hibby avatar Sep 09 '13 09:09 Hibby

But, but, that's standards-noncompliant!

ISO 8601 was published on 06/05/88 and most recently amended on 12/01/04.

benlk avatar Sep 09 '13 13:09 benlk

Hence why I didn't post in the discussion about compliant dates.

I see your non point about non compliance, and raise you tumblr... most blogs there aren't compliant with the famous 'No Geocities Design Atrocities Act' of 2005!

Hibby avatar Sep 09 '13 15:09 Hibby

The date parsing is done by PHP's date_create on line 94 of index.php.

What happens if instead of 2013-09-2 you put 2013-9-2?

benlk avatar Sep 09 '13 16:09 benlk

I like to write dates like 01-90-3102, But the standard still remains ISO8601. I don't see any reason of adding such functionality to Dropplets.

bndr avatar Sep 10 '13 19:09 bndr

Quite - the difference is that that's an impossible date - an edge case if you will. Only a few have a fetish for a date that's purposefully non conformant.

Most people, I'd wager, aren't aware there is a fixed standard for writing a date, and no amount of telling will make them do it the specified way.
Is it a case of you must write it one magic way, or is a slightly more tolerant approach a valid thing to consider? Yes - I'll give you that allowing tolerance for mistakes at every issue will lead to bloated and slow code, but it can also lead to a much better overall user experience.

Currently I've not been able to recreate the issue, but I've not had too much time to actually try - I'll have a fiddle and get back.

Hibby avatar Sep 10 '13 19:09 Hibby

If you want to change how the ISO8601 date is displayed in your theme, you can use the PHP date format variables to change what $date_format is set to in /dropplets/settings.php.

benlk avatar Sep 14 '13 19:09 benlk

Hi,

i just found out that the ordering is also wrong even with good date format... Post more on the same day (or with the same date), and you will see that the posts will display in REVERSED alphabetical order... I named manually my md files starting with numbers, and the last number was the first on the index page...

I hope somebody will find out how can we fix it... Maybe we should add the time (hh:mm) after the date in the Markdown file, but making it unvisible. Renaming the files is not a solution since the direct link is the name of the file.

I opened a new issue regarding this problem, feel free to discuss it there. https://github.com/circa75/dropplets/issues/246

peterrovid avatar Sep 19 '13 13:09 peterrovid