For the context , I know that apparently, YAML specifications don’t seem to allow partial dates corresponding to a certain subset of ISO8601, where one can omit the year and only have a “month + day” date (--MM-DD
) … and that’s fine …
What bothers me a little bit with this is that when one tries to add a partial date to Properties, Properties doesn’t seem to pick-up the “error” (as nothing is written in Source/YAML) and it can give the false sentiment that it’s indeed working …
Which I would consider as, if not a bug, at least something that was forgotten somewhere within the Properties data type validation …
Steps to reproduce
-
Open the Sandbox Vault
-
Add a date type of key to
Start Here.md
-
In the date placeholder (
yyyy-mm-dd
) sitting where the value for the date key will be:- Click on
mm
and manually add a month (e.g.:03
) - Hit the right arrow on the keyboard to navigate on day part of the placeholder and focus it, then add a value for the day (e.g.:
28
)
- Click on
-
Hit
Tab
to get back to the note and do what you have to do with it …
This results in Properties displaying something like yyyy-03-28
in Live Preview without any warning of any kind to say that this is in fact an invalid date (per YAML) and that it wasn’t registered in Source/YAML…
But as Properties still displays it, one can simply think that it indeed worked …
IMHO, this shouldn’t happen … I mean, trying to enter a partial date in a date key while not using the “pop-up” calendar shouldn’t silently fail : It should warn that something’s not entirely right there…
Did you follow the troubleshooting guide? [Y/N]
Yes, this has been tested in the Sandbox Vault
(No plugin, default theme, no css snippet)
I search for another bug report about this but only found a FR asking to allow partial dates in YAML.
I still hope this isn’t a duplicate though… Sorry if it is .
(Also, sorry if I didn’t make the right call and a FR would have been better )
Expected result
Having a warning, similar to the type mismatch
error, would be nice .
Actual result
Entering a partial date in Properties
simply silently fails…
One can think this has been registered, go on about their day, close the note where the partial date was apparently added and forget about it…
Then, later on, while using some other plugin and trying to access/manipulate that partial date in a way or another, it will also fail as the partial date simply doesn’t exist …
Of course, closing and re-opening the note where the partial date was wrongly “added” shows that it didn’t work as the partial date is replaced by the placeholder when the note is re-opened… But one needs to do that to see it or switch to source …
Environment
MacOS Big Sur 11.7.10
+ Obsidian 1.5.11
.
SYSTEM INFO:
Obsidian version: v1.5.11
Installer version: v1.5.8
Operating system: Darwin Kernel Version 20.6.0: Thu Jul 6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64 20.6.0
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
Here’s a screen-recording from the Sandbox Vault of what I see when I try to add a partial date to the date
key in Properties …
I switch to Source
to show that absolutely nothing is registered in YAML (logically) but there’s also nothing telling me that something’s is just wrong here …
EDIT : I forgot to add that adding a date
key to Properties
and adding a partial date to it as its value from the YAML in Source Mode, does indeed produce the expected type mismatch
warning when switching to Live Preview … It just doesn’t happen when one tries “the other way around” …