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

DateTime type date not changing #59

Open
hasnainusti opened this issue Feb 11, 2022 · 1 comment
Open

DateTime type date not changing #59

hasnainusti opened this issue Feb 11, 2022 · 1 comment

Comments

@hasnainusti
Copy link

I'm using DateTimePicker with type datetime. It was working fine but after upgrading flutter date stop changing. When I choose type only to date it works but when i chosse datetime date does not change but time changes.

@AndreLuizNogueira
Copy link

AndreLuizNogueira commented Sep 10, 2024

I just had this issue and first I traced it to the focusnode, removing the focus solved it... then debugging this library I found that in date_time_picker.dart, on line 844 it gets the correct date, but since it's a global variable it's getting updated back to the original date when it calls showTimePicker... since I didn't want to spend too much time on this I just added another local variable "String selectedDate = '';" on line 845, on line 850 I set it to "selectedDate = _sDate;" and on line 900 I replaced sDate with selectedDate;

below are the changes

image

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

No branches or pull requests

2 participants