Samasaur1 / samasaur1.github.io

the jekyll source for my website
https://samasaur1.github.io/
3 stars 0 forks source link

Add option to convert to local time; show time in comments #38

Closed Samasaur1 closed 1 year ago

Samasaur1 commented 1 year ago

This PR closes #28 and #34, as noted in the commits.

Before this PR, post date/times on the main page for each post were automatically converted from the site timezone to the local timezone, with no option to disable this other than disabling JavaScript entirely. This PR changes that behavior, storing a value in the user's localStorage that controls whether times should be converted from the site timezone to the local timezone (default false). It also adds a checkbox that controls this setting, but that checkbox is hidden because I'm not sure where I want to show it.

Additionally, this PR displays times on comments, which are converted from the comment time zone[^tz] to the site timezone, and also support being converted to the local timezone via the localStorage variable.

[^tz]: Although I initially wanted to support displaying comments in the commenter's time zone, I realized that this was infeasible for a number of reasons, chief among them that all comments appear to be in UTC since that is the timezone that my comments server is using.

Samasaur1 commented 1 year ago

Theoretically closing and reopening the PR should trigger the new CI check I just added