question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot format KeyboardDatePicker date with text characters

See original GitHub issue

me right now:

A GIF or MEME to give some spice of the internet

Environment

Tech Version
@material-ui/pickers 3.0.0
material-ui 4.0.1
React 16.8.6
Browser Chrome 74.0.3729.169
Peer library date-fns

Steps to reproduce

  1. Use MuiPickersUtilsProvider with DateFnsUtils utils.
  2. Use KeyboardDatePicker with format="MMM dd, yyyy" attribute and value.
  3. Attempt to adjust date via keyboard.

Expected behavior

One should be able to edit the text and input a new date.

For example, let’s work with the date “Dec 17, 2018”.

If I wished to adjust this date via keyboard, I would expect to be able to delete “2018” from the string and add “2017” instead. I would assume that the rest of the string would remain the same.

Actual behavior

When the text date is adjusted via keyboard, characters from the date are removed. After typing the first character, the string changes to “Dec 1, 7, 2”. When a second character is typed, the string changes to “Dec , 1, 7”

Live example

https://codesandbox.io/embed/materialuipickersusagedemo-vv0ou?fontsize=14

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
dmtrKovalenkocommented, Feb 23, 2020

Fixed in v4

4reactions
dmtrKovalenkocommented, May 28, 2019

Got it. We definitely need to do smth with it. That’s a case when auto generated mask is not working 😃

We cannot generate all masks, so it needs to be specified manually

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot format KeyboardDatePicker date with text characters
Use KeyboardDatePicker with format="MMM dd, yyyy" attribute and value. Attempt to adjust date via keyboard. Expected behavior. One should be ...
Read more >
Issue in Material UI keyboard date picker for type a value
1 Answer 1 · I don't want to set today date in default I want to set the date format for inial it...
Read more >
KeyboardDatePicker API - Material-UI Pickers
Name Type Default onChange * (date: DateIOType, value?: string | null) => void value * ParsableDate allowKeyboardControl boolean true
Read more >
Imported data date formatted as text Issue|How to Fix in 2 min
Sometimes, when we import data from a server, the date is formatted as text and then we are unable to do any formatting...
Read more >
DatePicker API - MUI X
Name Type Default onChange * func renderInput * func acceptRegex RegExp /\dap/gi
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found