-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐞 fc-date and fc-end is not being parsed correctly when a custom date format is set with hyphens #121
Comments
I did play with this updating this to allow spaces: let datebits = datestring.split(/(?!^)[-–—](?![^[]*])/); but unfortunately that ignores other delimiters that could be used in a date format. Realistically I need to actually parse these bits against the format that was specified. |
Yeah that's a good point. I only did a quick scan through the code, but can take a more in depth look and try to come up with an actual solution once I've got some time if you'd like. |
I think what would help most is any suggestion of additional tests for formats. ;) we have some, but obviously forgot this one. That way we fix this w/o breaking others. A split based on (any non-word/non-digit character) could also do it. The other option is not to use split at all, but use regex find. We need the first three, and then the starting position of content after that as the ordinal. |
@OhMyDeera Unfortunately I have spent quite a bit of time trying to fix this issue but its almost impossible to make this generic. I am going to update the setting in the creator to reflect that this is for the Display Date format, and require dashes when parsing. |
Check for existing bug reports before submitting.
Expected Behavior
Unsure if this is a bug or working as expected.
Changing the date format from YYYY-MM-DD to DD MMM YYYY and updating the
fc-date
andfc-end
to be in the same format should have only changed the format of the date displayed in the calendar view.Current behaviour
Closing and reopening obsidian after changing the format to DD MMM YYYY removes all automatic events from the calendar.
Reproduction
fc-calendar
,fc-date
andfc-end
frontmatter properties.Calendarium: Must specify all three segments in DD MMM YYYY order. From 'Sessions/Untitled.md', date value: '24 Aug 0034'
Which Operating Systems are you using?
Obsidian Version Check
1.5.12
Plugin Version
1.1.0
Confirmation
Possible solution
update the following line (event-helper.ts [line 346]) to allow space as a separator:
let datebits = datestring.split(/(?!^)[-–—](?![^[]*])/);
I know that you can also use the date object, but I prefer editing the date without having to go into source view.
The text was updated successfully, but these errors were encountered: