Skip to content
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

Attempting to edit a date field with a cleared date results in invalid date error #936

Closed
xanderbeberman opened this issue Aug 9, 2024 · 2 comments · Fixed by #931 or #948
Closed
Labels
kind/bug Something isn't working lifecycle/active priority/critical Must be must be worked on before anything else. triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label.
Milestone

Comments

@xanderbeberman
Copy link

What happened?

This first happened to me when attempting to edit a field with an existing date in the board editor view. Clicking away from the date field caused the date to go blank, and then attempting to add a new date did not add anything—this eventually broke the Table view and "Include Fields" selector on the board view, and caused the date associated with the note to be "Invalid Date."

With more digging, this seems to happen when editing a date that has been cleared, either manually or by clicking away in the board tab editor. When attempting to set a date from a date that has not been cleared, everything works fine.

After editing a cleared date I see this warning:

The specified value "Invalid Date" does not conform to the required format, "yyyy-MM-dd".
p @ plugin:obsidian-projects:167
QV @ plugin:obsidian-projects:32
r1 @ plugin:obsidian-projects:32
Promise.then (async)
PO @ plugin:obsidian-projects:32
rq @ plugin:obsidian-projects:32
eval @ plugin:obsidian-projects:32
u @ plugin:obsidian-projects:197
o @ plugin:obsidian-projects:197
D @ plugin:obsidian-projects:197
eval @ plugin:obsidian-projects:32
Ee @ plugin:obsidian-projects:32
l @ plugin:obsidian-projects:167

Viewing the date with the Table view or with "Include Fields" checked on the Board tab gives this error:

plugin:obsidian-projects:197 Uncaught (in promise) RangeError: Invalid time value
    at CR (plugin:obsidian-projects:197:60826)
    at ure (plugin:obsidian-projects:197:61101)
    at U (plugin:obsidian-projects:32:7188)
    at new Ww (plugin:obsidian-projects:197:61506)
    at Array.Dre (plugin:obsidian-projects:197:65868)
    at Array._re (plugin:obsidian-projects:197:64461)
    at xR (plugin:obsidian-projects:197:63651)
    at AR (plugin:obsidian-projects:197:66683)
    at Kt (plugin:obsidian-projects:32:5129)
    at Object.p (plugin:obsidian-projects:197:67299)
CR @ plugin:obsidian-projects:197
ure @ plugin:obsidian-projects:197
U @ plugin:obsidian-projects:32
Ww @ plugin:obsidian-projects:197
Dre @ plugin:obsidian-projects:197
_re @ plugin:obsidian-projects:197
xR @ plugin:obsidian-projects:197
AR @ plugin:obsidian-projects:197
Kt @ plugin:obsidian-projects:32
p @ plugin:obsidian-projects:197
QV @ plugin:obsidian-projects:32
r1 @ plugin:obsidian-projects:32
Promise.then (async)
PO @ plugin:obsidian-projects:32
rq @ plugin:obsidian-projects:32
eval @ plugin:obsidian-projects:32
u @ plugin:obsidian-projects:167

What did you expect to happen?

  1. When clicking away from a date field in the Board editor view, the date field is not cleared
  2. When attempting to set a new date from a date that has been cleared, the date is set successfully

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

In Table view

  1. Create or use a note with a date field
  2. Clear the date from the field
  3. Attempt to set a new date
obsidian-issue-table.mov

In Board view

  1. Click on a note with a date field
  2. Click on the date field, then click away - this clears the date
  3. Attempt to set a new date
  4. To reproduce Uncaught RangeError, include date field in card view
obsidian-issue-board.mov

Anything else we need to know?

No response

Plugin version

1.17.4

Obsidian version

1.6.7

OS

macOS

@xanderbeberman xanderbeberman added kind/bug Something isn't working needs-triage Issue needs a triage/* label labels Aug 9, 2024
@Acylation
Copy link
Collaborator

Acylation commented Aug 9, 2024

Yeah I've just noticed it and pushed a fix in #931. Will deploy soon.

Date got cleared in Edit Note pop out by click outside is unexpected. Will do some investigation.

@Acylation Acylation added triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label. and removed needs-triage Issue needs a triage/* label labels Aug 9, 2024
@Acylation Acylation added this to the next milestone Aug 9, 2024
@Acylation Acylation added priority/critical Must be must be worked on before anything else. lifecycle/active labels Aug 9, 2024
@xanderbeberman
Copy link
Author

That's great to hear, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working lifecycle/active priority/critical Must be must be worked on before anything else. triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label.
Projects
None yet
2 participants