-
Notifications
You must be signed in to change notification settings - Fork 119
WIP: Introduce Temporal to handle date and time [Conflict Resolved] #1004
base: main
Are you sure you want to change the base?
Conversation
Add input event handler call to DateInput Shift to local DateInput component Reserve submitting null when no cache Simplified date / datetime input Clean up
Write date string back according to timezone Only reserve non-local timezone marks, non-DST save. Possible solution should be providing settings to specify user zone Add hint Resume input events on date inputs Extend date string support for timezoneId Fix date parsing Remove dayjs Cancel default date filling in field creation Refactor date string parsing Clean up redundant comments and tests Fix bugs on filters and card display Fix calendar date range Refactor calendar with Temporal Seems buggy, needs unit test to calendar helpers Refactor using Temporal Stage 1: Handle most views and sorts, except for calendar
|
How exciting! I've been following the news on Temporal in the past, but didn't realize it's ready to use these days. I may not be able to review this during this week, but I'll be sure to try this out and have some comments at the end of next week at the latest. |
|
That sounds great! Just to clarify, Temporal is not fully product-ready yet—I’m currently using the polyfill maintained by the FullCalendar team: fullcalendar/temporal-polyfill. That said, there’s been exciting progress recently. Temporal documentation has been added to MDN, and it has entered the experimental stage in some browsers. While it’s still a long way from being fully mature, I’m considering early adoption. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal Regarding time zone handling, to align with Obsidian Properties UI’s behavior (Ref), we still need to use Definately not in a hurry and I'll be working on fixing minor bugs this week. Looking forward to your thoughts when you get a chance to try it out! |
- Ensure events display on the correct date, considering timezone - Persist DnD date correctly in calendar view, considering timezone
Closes #994, #974
Possibly to close #430 if plugin-specified locale settings are required
https://forum.obsidian.md/t/properties-let-the-user-customize-the-way-dates-times-are-displayed-independently-from-os/64139
May fix #969 together if the date field detection is enhanced
May better handle #764
Currently in alpha stage, functions with bugs
@marcusolsson Hi! Since this is a significant change, could you take some time to review the design?
In short, I’m converting all date/datetime strings into
ZonedDateTimeobjects internally, defaulting to the user’s local time. When displayed, the timezone info is truncated, behaving likePlainDate/PlainDateTime.For edits in the Projects UI, only values with a different timezone offset from the user’s local zone will retain the offset suffix.
For example, if the user’s timezone is
-05:00, adding one minute results in:2025-02-03T12:31→2025-02-03T12:322025-02-03T12:31-05:00→2025-02-03T12:322025-02-03T12:31-08:00→2025-02-03T12:32-08:00