-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
[@nativescript/datetimepicker] Exception on Android with NS7 and v2.0.4 #47
Comments
Same here with same exact conditions, my error is:
|
Closing for now. I believe this is fixed. Currently with NS8x on Android I've not encountered this with the following code which is taken from a production app where the tap event is on a textfield that ends up showing the picker. We can reopen if still experiencing. import { DateTimePicker, DateTimePickerStyle } from '@nativescript/datetimepicker';
import { Application, Button } from '@nativescript/core';
export function someButtonTapToOpenThePicker(args) {
const dateTimePickerStyle = DateTimePickerStyle.create(args.object as any);
// This example handles styling the calendar for light and dark mode of the device settings
if (Application.systemAppearance() === 'dark') {
// style for dark mode
dateTimePickerStyle.buttonsBackgroundColor = new Color('#202125');
dateTimePickerStyle.dialogBackgroundColor = new Color('#202125');
dateTimePickerStyle.titleTextColor = new Color('#fff');
dateTimePickerStyle.buttonsTextColor = new Color('#0067a6');
dateTimePickerStyle.spinnersBackgroundColor = new Color('#202125');
dateTimePickerStyle.spinnersTextColor = new Color('#fff');
} else {
// style for light mode
dateTimePickerStyle.buttonsBackgroundColor = new Color('#fff');
dateTimePickerStyle.dialogBackgroundColor = new Color('#fff');
dateTimePickerStyle.titleTextColor = new Color('#0067a6');
dateTimePickerStyle.buttonsTextColor = new Color('#0067a6');
dateTimePickerStyle.spinnersBackgroundColor = new Color('#fff');
dateTimePickerStyle.spinnersTextColor = new Color('#0067a6');
}
DateTimePicker.pickDate(
{
context: (args.object as Button)._context,
date: yourDateValue
minDate: subYears(new Date(), 10),
maxDate: new Date(),
title: 'DatePicker'
okButtonText: 'Okay',
cancelButtonText: 'Cancel',
locale: 'en'
},
dateTimePickerStyle
).then((result) => {
// handle the result
})
} |
From NativeScript/nativescript-datetimepicker#77:
If the demo apps cannot help and there is no issue for your problem, tell us about it
I get the following exception when trying to load the date picker on Android using NS7 and @nativescript/datetimepicker@2.0.3 (and @2.0.4). The picker never displays.
I have a TextField with an tap listener
getDate
that calls:Exception
This works fine on NS7 iOS14
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
I created a new project (
ns create picker --vue
) and added a TextField with an onTap handler calledgetDate
. Run the debugger on the app, monitor All Exceptions, then tap the TextField. You should see the error. I've attached the minimal test project.The text was updated successfully, but these errors were encountered: