mna/trofaf

When two posts are made on the same day, they may sort in the wrong order

Closed this issue · 3 comments

This is because their timestamp is only a day, rather than a precise time. The most solution would be allowing full timestamping in the frontmatter, such as with with time.RFC3339: 2006-01-02T15:04:05Z07:00.

The problem with this is that some users may prefer to compose their frontmatter by hand. For this, simple dates (2006-01-02) may function adequately, but would require a little bit of supporting code in the parser, to allow either.

mna commented

Yes, that was good enough for me (for now at least), but it could be an inconvenience. It should probably allow something along the lines of 2006-01-02 15:04 or 2006-01-02 15h. I don't see how seconds can be meaningful in this case.

Yeah, I think seconds will be entirely useless. (If you're composing
blog posts in under a minute, your skills are needed in more important
places.)

The purpose for using them, though, would be for full RFC3339
compliance - it's easy enough to autofill with date --rfc3339 seconds (2013-08-05 17:17:57-04:00). It's also easy to autofill
with just the hour and minute, though, assuming you're familiar with
date. (%Y-%M-%d %H:%m will format this.)

mna commented

Please note that Go's time.RFC3339 doesn't seem to like the missing T in 2013-08-05 17:17:57-04:00, it only parses correctly if it is 2013-08-05T17:17:57-04:00. I'm not familiar enough with the date command to tell if this is a problem or not.