Skip to content
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

Respect timezone even in last modified date when timeZone was set #249

Merged
merged 2 commits into from Oct 28, 2022

Conversation

everpeace
Copy link
Contributor

@everpeace everpeace commented Oct 28, 2022

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

This PR stops forcefully converting the last modified date into UTC to respect Hugo's timeZone configuration.

As described in #249 (comment), I understand this will be a breaking change. If we should keep backward compatibility, I will open another PR to introduce params.forceUTCInLastMod (key name is subject to discuss).

Test plan

No particular test plan because the change is small. I checked in my local as below:

  • config.yaml:
    timeZone: Asia/Tokyo
    params:
      dateFormat: January 2, 2006 at 3:04 PM MST
      shortDateFormat: 15:04 MST — Jan 2
      enableLastMod: true
  • last modified info in git:
    git --no-pager log -1 content/issues/2022-10-27-sample-issue.md
    commit 4b...masked....14
    Author: ...masked....
    Date:   Thu Oct 27 20:07:33 2022 +0900

Then, rendered fotter was:

image

Closing issues

closes #248

@mistermantas mistermantas changed the base branch from master to dev October 28, 2022 11:13
@mistermantas mistermantas merged commit 7b99f99 into cstate:dev Oct 28, 2022
@everpeace everpeace deleted the patch-1 branch October 28, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect timezone even in last modified date when timeZone was set
2 participants