material-ui-pickers icon indicating copy to clipboard operation
material-ui-pickers copied to clipboard

Not correct display date

Open SergeyWebDeveloper opened this issue 7 years ago • 10 comments

Updated from version 1.x to the latest and now the display of dates is wrong. I use last version @material-ui/core, react. The reinstallation of the node_modules gave nothing.

screenshot_1

SergeyWebDeveloper avatar Jan 15 '19 08:01 SergeyWebDeveloper

You must also update date-fns version and install up-to-date @date-io/date-fns

dmtrKovalenko avatar Jan 15 '19 08:01 dmtrKovalenko

https://codesandbox.io/s/q9l2j10wr4?from-embed

dmtrKovalenko avatar Jan 15 '19 08:01 dmtrKovalenko

@dmtrKovalenko , install date-fns solved the problem, but now, apart from the current month and year, no other dates are chosen

SergeyWebDeveloper avatar Jan 15 '19 08:01 SergeyWebDeveloper

@SergeyWebDeveloper please make sure all dependencies installed the same as in the code sandbox that I sent you later.

dmtrKovalenko avatar Jan 15 '19 08:01 dmtrKovalenko

@dmtrKovalenko , thx, problem is solved.

SergeyWebDeveloper avatar Jan 15 '19 10:01 SergeyWebDeveloper

Having the same problem. Using these versions:

"@date-io/date-fns": "~1.1.0",
"@material-ui/core": "~3.9.1",
"date-fns": "2.0.0-alpha.21",
"material-ui-pickers": "~2.2.4",

iakovosvo avatar Mar 12 '19 11:03 iakovosvo

@iakovosvo seems like that your date-fns version still is 1.0.0

dmtrKovalenko avatar Mar 12 '19 11:03 dmtrKovalenko

@iakovosvo , The problem was in the date-fns. In the alpha version they have changed API. For example, in version ^2, you need to set the format as yyyy-MM-dd.

SergeyWebDeveloper avatar Mar 12 '19 11:03 SergeyWebDeveloper

I have tried that and a bunch of different format combinations but I am still getting gibberish values on the DatePicer. I only get correct values on the input below the label.

iakovosvo avatar Mar 12 '19 11:03 iakovosvo

@iakovosvo , show an example of how you do in the sandbox

SergeyWebDeveloper avatar Mar 12 '19 11:03 SergeyWebDeveloper