timvink / mkdocs-git-revision-date-localized-plugin

MkDocs plugin to add a last updated date to your site pages
https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html
MIT License
198 stars 40 forks source link

`timezone` appears not to work #79

Closed aforsythe closed 2 years ago

aforsythe commented 2 years ago

Maybe I'm misinterpreting the setting, but the time when type: datetime always shows the same time regardless of timezone

I've tried setting timezone: America/Los_Angeles, timezone: US/Pacific, timezone: UTC, and timezone: Europe/Amsterdam

Time displayed doesn't change.

timvink commented 2 years ago

Looks like you're right.. the right part should be timezone (without the underscore).

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/01d8bc58d24abca264d18ea00a9e2e19dc87ed72/mkdocs_git_revision_date_localized_plugin/util.py#L193

The None value in turn will cause the system's local timezone to be returned by babel's get_timezone():

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/01d8bc58d24abca264d18ea00a9e2e19dc87ed72/mkdocs_git_revision_date_localized_plugin/util.py#L65

Which is probably why no one has noticed issue.

I need to write more and proper unit tests. Will also fix this one soon :)

timvink commented 2 years ago

Fixed in v0.12.1 !