Skip to content

feat(NcDateTimePicker): manual date input#8443

Open
SebastianKrupinski wants to merge 1 commit intomainfrom
fix/NcDateTimePicker-Manual-Input
Open

feat(NcDateTimePicker): manual date input#8443
SebastianKrupinski wants to merge 1 commit intomainfrom
fix/NcDateTimePicker-Manual-Input

Conversation

@SebastianKrupinski
Copy link
Copy Markdown

@SebastianKrupinski SebastianKrupinski commented Apr 18, 2026

☑️ Resolves

  • Fix manual date input
  • Re-parses manual date input if VueDatePicker fails
  • Submits manual input on enter, tab or blur

🖼️ Screenshots

Recording.2026-04-18.210922.mp4

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.58%. Comparing base (7f48617) to head (0f5e4fc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8443      +/-   ##
==========================================
+ Coverage   54.55%   54.58%   +0.02%     
==========================================
  Files         104      104              
  Lines        3400     3400              
  Branches      993      993              
==========================================
+ Hits         1855     1856       +1     
+ Misses       1306     1305       -1     
  Partials      239      239              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SebastianKrupinski SebastianKrupinski self-assigned this Apr 19, 2026
@SebastianKrupinski SebastianKrupinski added the 3. to review Waiting for reviews label Apr 19, 2026
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@SebastianKrupinski SebastianKrupinski force-pushed the fix/NcDateTimePicker-Manual-Input branch from 421b475 to 0f5e4fc Compare April 19, 2026 01:32
@SebastianKrupinski SebastianKrupinski marked this pull request as ready for review April 19, 2026 01:34
@ShGKme ShGKme added bug Something isn't working feature: datepicker Related to the date/time picker component labels Apr 19, 2026
@ShGKme ShGKme added this to the 9.7.0 milestone Apr 19, 2026
@ShGKme ShGKme added enhancement New feature or request and removed bug Something isn't working labels Apr 19, 2026
@ShGKme ShGKme changed the title fix(NcDateTimePicker): manual date input feat(NcDateTimePicker): manual date input Apr 19, 2026
@ShGKme
Copy link
Copy Markdown
Contributor

ShGKme commented Apr 19, 2026

Changing to feat, it introduces a new API.

Copy link
Copy Markdown
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I'm unsure if it makes sense to have manual input without masking the value or explicitly specifying the format to the user.

It is clear when editing the current value, but quite unclear for new values.

What about disabling manual input at all?
cc @nextcloud-libraries/designers

Comment on lines +425 to +430
/**
* Enable or disable manual text input for the date picker.
*
* @default true
*/
manualInput?: boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We follow no-boolean-default props as more natural for HTML-styled template, allowing using boolean shortcut like in HTML.

<!-- default: true -->
<NcDateTimePicker />
<NcDateTimePicker :manualInput="false" />

<!-- default: false -->
<NcDateTimePicker />
<NcDateTimePicker noInput />
Suggested change
/**
* Enable or disable manual text input for the date picker.
*
* @default true
*/
manualInput?: boolean
/**
* Disable date text input
*/
noInput?: boolean

or

Suggested change
/**
* Enable or disable manual text input for the date picker.
*
* @default true
*/
manualInput?: boolean
/**
* Disable date text input
*/
noTextInput?: boolean

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this as manualInput with a boolean on purpose, the underlying component actually supports:

  • False
  • True
  • Options {
    enterSubmit = true,
    tabSubmit = true,
    }

This way the options can be implemented later without having multiple props and/or breaking functionality.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Grigorii here, we should stick with no boolean default rather than some underlying library.
In general we should not care about the library we wrap as we should define an interface and translate this to the library and not the otherway around.

Comment on lines +877 to +879
@keydown.enter.capture="onManualInputKeySubmit"
@keydown.tab.capture="onManualInputKeySubmit"
@textInput="onTextInput"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks accessibility by preventing using the data picker (the menu popup) via keyboard.

Previously, when the focus was in the input field, the menu could be open by typing or pressing Space, and then moving the focus to the menu by Tab

Now, Space acts as text input, and Tab goes to the next element, without opening the menu.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user can type in a date, this is much easier then trying to navigate a popup menu with a keyboard, so I don't seem this as a problem.

Alternatively we could disable the tab capture and a user can tab in to the menu.

I was actually thinking of disabling the popup menu on manual input, but thought is was a good visual feed back that the correct date is selected.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But not if the input value is changed significantly.

I enter 10/22/2026. Then I want to edit it changing the month, for example, 10 to 11. I go back and get Oct 22, 2026, where I actually need to change Oct to Nov.

}

const input = event.target instanceof HTMLInputElement ? event.target.value : ''
const tempDate = new Date(input)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with the date input and date-time input, but it breaks on the week input, the month input, the year input and the range input.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, will look in to it.

@ShGKme ShGKme requested a review from susnux April 19, 2026 07:32
@SebastianKrupinski
Copy link
Copy Markdown
Author

In general, I'm unsure if it makes sense to have manual input without masking the value or explicitly specifying the format to the user.

This implementation supports multiple input formats, the one in the video above in not event a standard input format,

You can input,

YYYY-MM-DD

MMM DD YYYY

DD.MM.YYYY

DD/MM/YYYY

So forcing the user to use a specific format is not feasible, also since users are uses to using their localized format.

@ShGKme
Copy link
Copy Markdown
Contributor

ShGKme commented Apr 19, 2026

So forcing the user to use a specific format is not feasible, also since users are uses to using their localized format.

The first problem is specifying. Without knowing the supported format, a user just doesn't know in what format they should enter the data.

...in not event a standard input format

Which makes it even harder if a user didn't learn the "JS Date parser" format.
(Just leaving it here: https://jsdate.wtf)

You can input ...

... DD.MM.YYYY

I cannot, this is an Invalid date in JS.

image

DD/MM/YYYY

But it will be parsed as MM/DD/YYYY.
If I enter 02/03/2026 I get February 3rd, not March 2nd.

image

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented Apr 20, 2026

From the design side, it is tricky. Being able to manually enter a date is really valuable, but indeed, https://jsdate.wtf.

But I've also seen this done right. There are only so many possible date formats out there, and they are documented. People have wrote parsers before that cover 99.5% of what users will input, aside from typos. I'd like that.

But it's also fine to just have a placeholder in ISO 8601 for new values, like just the string YYYY-MM-DD, then the user can be expected to follow a format they see.

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

Labels

3. to review Waiting for reviews enhancement New feature or request feature: datepicker Related to the date/time picker component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants