Closed lehmacdj closed 3 years ago
@srid would it be possible to get some details on how this could be implemented as a plugin? It seems as though to some extent supporting time zones requires changing the data types used within the core? Specifically, it seems like it would require using either UTCTime
or ZonedTime
from Data.Time rather than just Day
and TimeOfDay
as DateMayTime
currently does.
@lehmacdj Sorry, I let this slip my radar.
Let's not worry about the plugin stuff. Your implementation approach sounds generally good to me, but isn't there a way we can avoid having to add a new config field? I like letting the full datetime value specify the timezone (+0000
); if we do that, then we wouldn't need to worry about telling neuron.dhall as to how to interpret timezone?
No worries!
Sure, we can avoid having a config field I think. We would
Sounds good to me. PR welcome!
Sent from ProtonMail mobile
-------- Original Message -------- On Feb. 11, 2021, 11:13 p.m., Devin Lehmacher wrote:
No worries!
Sure, we can avoid having a config field I think. We would
- write timezone by default when creating a new Zettel
- interpret any time without a specified timezone as being in the current timezone when parsing
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Closing per https://neuron.zettel.page/next ... to further discuss this idea, post in Emanote repo.
(In particular, in Emanote you can access any arbitrary YAML metadata in the HTML templates)
I would like to use UTC timestamps for times in my zettelkasten so that changing timezones doesn't mess things up. Ideally this would make neuron create new notes using UTC time, and also interpret times in notes as UTC time wherever relevant.
Based on a cursory look at the codebase, it seems like everything uses LocalTime internally right now (e.g. DateMayTime). Probably the easiest option is to offer an override for the system provided timezone in neuron.dhall. This way one doesn't need to remember to pass a flag whenever using a zettelkasten using a different timezone than one's system defined one.
As far as implementation would go I would propose:
NewCommand
passMaybe DateMayTime
newZettelFile
fetch the current time as a default if there was no time passed via an optiontimezone
config option?) for determining what timezone to use for when fetching a timeI would be happy to send a PR if you would accept such a PR.
Longerterm it would be great to have more comprehensive timezone support, i.e.:
+0000
suffixes and parsing these appropriately)DateMayTime
type, so I am steering away from trying to address this before ever having made a PR to this repo :)