Skip to content

The wrong date can be used in the url #7550

@scottdorman

Description

@scottdorman

My Environment

This is building on the latest version of github-pages.

Expected Behaviour

For a post with a front matter date of date: '2015-05-28 23:23:39.00000000 -05:00', the URL generated should have the date portion as 2015/05/28. For additional (older) information, see #1069.

Current Behavior

This issue reported in #1069 seems to still exist.
Look at https://scottdorman.github.io/2015/05/29/introducing-jquery-gotop/ https://scottdorman.github.io/2015/05/28/introducing-jquery-gotop/ as an example.

The date portion of the link gets set to 2015/05/29 even though the front matter has date: '2015-05-28 23:23:39.00000000 -05:00' and my _config.yml has timezone: America/New_York. I have tried the front matter date in several variations and none of them seem to make any difference.

This issue affects a bunch of pages for me and also has an impact on some automatic redirection logic I have set up since the date portions of the links don't match up.

If there's something I need to change, I'm all for changing it but it seems like this is an issue with how Jekyll is parsing the date front matter variable to generate the URL. If the date has timezone information provided (which mine does) it should always use that timezone.

Interestingly enough, as I was writing this I decided to try setting the date to the corresponding UTC time (2015-05-29 03:23:39) which still had no effect. However, when I set the date back to the original and removed the time zone portion, it was generated with the correct date in the URL. This behavior seems widly inconsistent, as other pages seem to work just fine with the time zone in the date (as a string) (see https://github.com/scottdorman/scottdorman.github.io/blob/master/_posts/2018/2018-08-18-saving-bootstrap-component-state.md as an example). It seems like where things start to go wrong is when the time approaches that roll-over period in UTC (so, for my time zone any dates earlier than 19:00:00 generate with the correct date and anything after would appear to generate with the wrong date).

Code Sample

The repository where this is happening is https://github.com/scottdorman/scottdorman.github.io. See files/URLs referenced above for specific examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions