-
Notifications
You must be signed in to change notification settings - Fork 29
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
Date doesn't change when mode is dateAndTime #39
Comments
Is this only in dateAndTime mode? |
Hi,
Yes it is. It is the transition between the date picker and time picker
that the issue occurs, the time picker takes the original input date which
overwrites any change made in the date picker
Regards,
Steve
Steve Allam | Director | Imhotek UK Ltd
Mob: 07976 522793
Shamelessly advertising my son's T-shirts at: shop.boldpen.uk
…On 18 April 2021 00:06:33 Daniel Pereira ***@***.***> wrote:
Is this only in dateAndTime mode?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This is fixed by #35 |
i confirm but it still needs to be updated on npm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The date does not change when mode "dateAndTime" is used (and there is an initial date in options)
in DatePickerPlugin.java, on completion of the DatePickerDialog, if mode is dateAndTime, the routine 'launchTime()' is called.
The first thing launchTime does is:
This sets the time from the pickerDate variable, which is the input date to the whole component, hence ignoring any changes that might have been made by the DatePickerDialog. The same logic is repeated a bit further down in the same function.
If changed to:
if (pickerMode.equals("time") && (pickerDate != null)) {
calendar.setTime(parseDateFromString(pickerDate));
}
Then all is ok.
To Reproduce
Steps to reproduce the behavior:
var opts:DatePickerOptions = { date: "2021-04-17T20:00", mode: "dateAndTime", format:"yyyy-MM-dd'T'HH:mm", theme: "light", is24h: true };
DatePicker.present(opts).then((res) =>
{
console.log('date result'+JSON.stringify(res));
});
Expected behavior
The date to change!
Additional context
"@capacitor-community/date-picker": "^0.2.3",
"@capacitor/android": "^2.4.7",
"@capacitor/cli": "^2.4.7",
"@capacitor/core": "^2.4.7",
"@ionic-native/core": "^5.32.0",
The text was updated successfully, but these errors were encountered: