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

Opening a DateTimePicker with invalid default value throws an error #824

Closed
wichert opened this issue Dec 28, 2018 · 8 comments
Closed

Opening a DateTimePicker with invalid default value throws an error #824

wichert opened this issue Dec 28, 2018 · 8 comments
Labels
bug 🐛 Something isn't working luxon

Comments

@wichert
Copy link

wichert commented Dec 28, 2018

This uses the same example as #823, but shows a different issue.

Environment

Tech Version
material-ui-pickers 2.0.5
material-ui 3.7.1
React 16.4.0
Browser all
Peer library Luxon 1.8.3

Steps to reproduce

  1. Click on the date-time picker

Expected behavior

I expect the modal to open up with the current input value selected, so I can change it to something else.

Actual behavior

An uncaught exception is thrown:

TypeError
value.set is not a function. (In 'value.set({ hour: count })', 'value.set' is undefined)

Live example

https://codesandbox.io/s/6wxqo5mxnz

@dmtrKovalenko
Copy link
Member

image

@dmtrKovalenko dmtrKovalenko added the status: incomplete Need more information label Dec 28, 2018
@wichert
Copy link
Author

wichert commented Dec 28, 2018

Can you try https://codesandbox.io/s/k0xymx0wx5 as sandbox? That gives me:

screenshot 2018-12-28 at 13 18 07

@dmtrKovalenko dmtrKovalenko added bug 🐛 Something isn't working luxon and removed status: incomplete Need more information labels Dec 28, 2018
@dmtrKovalenko
Copy link
Member

@wichert it doesnt throw an exception for me, but selecting incorrect date as default

@dmtrKovalenko
Copy link
Member

Another issue I found. That it should not disable today with disablePast option

@wichert
Copy link
Author

wichert commented Dec 28, 2018

I just ran into that one as well :)

@wichert
Copy link
Author

wichert commented Dec 29, 2018

@dmtrKovalenko Are you clicking the datetime picker? That gives me an exception on multiple browsers.

@dmtrKovalenko
Copy link
Member

Yeah, I see. Indeed it must be fixed.

@dmtrKovalenko
Copy link
Member

@wichert that not an issue. I figured out that you have set the date manually to the December 24th. So it is in the past now :)

dmtrKovalenko added a commit that referenced this issue Jan 2, 2019
…#829)

* [#824] Fix crashing if openning datepicker with error

* Make default datetimepicker example show today
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working luxon
Projects
None yet
Development

No branches or pull requests

2 participants