Skip to content

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

@everpeace

Description

@everpeace

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions