marcusolsson/obsidian-projects

Date(time) fields don't work with ISO 8601 format when UTC offset is specified

Opened this issue · 2 comments

ltroj commented

What happened?

In my notes i use datetime fields which are formatted according to ISO 8601 including UTC offset like this:

2024-11-10T16:04+02:00

These fields aren't recognized as dates by obisidan-projects for use in calendar views for example. In table view the field is shown as Text type.

Removing the UTC offset like this does seem to work though:

2024-11-10T16:04

What did you expect to happen?

I Expect datetime fields in the format of 2024-11-10T16:04+02:00 to be recognized as such.

How can we reproduce it (as minimally and precisely as possible)?

Create a note with frontmatter:

---
date-test: 2024-11-10T16:04+02:00
---

and try to use the field date-test for calendar views.

Anything else we need to know?

No response

Plugin version

1.17.4

Obsidian version

1.7.7

OS

Windows

Yes thanks for reporting. Will be solved together with issue #940

Note to myself: More work needed towards the actual support of timezone offsets. Now the datetime are majorly taken care of by dayjs, but unfortunately by default it will conduct local conversion when displaying. Possibly be a useful feature, but we'd better make this configurable (trim off the timezone / do the local conversion)