Skip to content

fix(events): do not discard text input of dates and times in event edit dialog#8433

Open
odzhychko wants to merge 1 commit into
mainfrom
8307-can-no-longer-edit-time
Open

fix(events): do not discard text input of dates and times in event edit dialog#8433
odzhychko wants to merge 1 commit into
mainfrom
8307-can-no-longer-edit-time

Conversation

@odzhychko
Copy link
Copy Markdown
Contributor

Provisional fix for #8307 until I can properly fix it in @nextcloud/vue .

The comments in the code describe how this fix works.
The underlying issue is that NcDateTimePicker specifies how to format dates/times but not how to parse them back.

Possible issues with this fix

  • datetime-locale-patterns might use older locale data than used by browsers for Intl.DateTimeFormat
    • this would result in dates/times formatted differently if the spec for a locale was recently changed
  • datetime-locale-patterns bundles more locale data then possibly needed for locales supported by Nextcloud

Before

Screencast.from.2026-06-03.16-17-41.webm

After

Screencast.from.2026-06-03.16-16-14.webm

…it dialog

Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
@odzhychko odzhychko linked an issue Jun 3, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@SebastianKrupinski
Copy link
Copy Markdown
Contributor

Hey,

I'm not against doing it this way, but..

I had a look at this and yes this is a way to temporarily fix this. The issue with the temporary part is that we never, end up getting time to the actually fix it properly and temporary becomes permanent. So I am big supporter of not cutting corners and fixing the issue where it is being caused. (nextcloud/vue),

As for the extra parsing library, I don't know if this is needed, the nc/vue pr I did to fix this used Date() to parse and it worked correctly, 99% of the time. Can we just use the built in date() function instead of another dependency?

@odzhychko
Copy link
Copy Markdown
Contributor Author

@SebastianKrupinski Thanks for looking it over.

The issue with the temporary part is that we never, end up getting time to the actually fix it properly and temporary becomes permanent.

Yeah, I know what you mean. If it helps, I do not intend to mark #8307 as finished until I fix it at the root.

As for the extra parsing library, I don't know if this is needed, the nc/vue pr I did to fix this used Date() to parse and it worked correctly, 99% of the time.

I think using Date() will not work for all locales. It fails, for example, for es:

new Date(Intl.DateTimeFormat('es', { dateStyle: 'medium' }).format(new Date('2026-12-30')))

But maybe I miss something.
I plan to test all locales automatically in the proper fix in nc/vue.
I can be more sure then.

Can we just use the built in date() function instead of another dependency?

I also don't like the extra dependency. When make a fix in the NcDateTimePicker I will look for existing depencies that might solve this. @nextcloud/moment seems to be a good candidate for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can no longer edit time

2 participants