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 #248

Open
everpeace opened this issue Oct 28, 2022 · 1 comment · Fixed by #249
Open

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

everpeace opened this issue Oct 28, 2022 · 1 comment · Fixed by #249

Comments

@everpeace
Copy link
Contributor

everpeace commented Oct 28, 2022

Is your feature request related to a problem? Please describe.

I set timezone explicitly in config.yaml like:

timeZone: Asia/Tokyo
params:
  dateFormat: January 2, 2006 at 3:04 PM MST
  shortDateFormat: 15:04 MST — Jan 2
  enableLastMod: true

Then, issue date was rendered in expected timezone (JST in this case). But, last modified date was not.

issue metadata:

---
title: Sample Issue
date: 2022-10-27 01:00:00
...

rendered issue header:
image

rendered issue footer:
image

Describe the solution you'd like
A clear and concise description of what you want to happen.

If cstate prioritized backward compatibility, I would introduce forceUTCInLastMod: true|false (default is true).

Or, it would be fine just to remove .UTC part from:

{{ .Lastmod.UTC.Format .Site.Params.dateFormat }}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

none.

@everpeace everpeace changed the title Respect timezone even when enableLastMod and dateFormat is set Respect timezone even in last modified date when timeZone was set Oct 28, 2022
@mistermantas
Copy link
Member

Makes sense to me! The time zone should be in one format for the UI anyway.

I'll check what the API outputs if anything in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants