jQuery UI Widgets › Forums › Editors › DateTimeInput › Input in Android
Tagged: Android
This topic contains 7 replies, has 2 voices, and was last updated by Peter Stoev 9 years, 2 months ago.
-
AuthorInput in Android Posts
-
Hi,
I am new to jqWidgets, and have really been amazed about the quality and completeness of the functionality. The jqxGrid is now fully functional on my development site, and I am now working on getting the DateTimeInput. I am using this in jQuery Mobile. So far really easy, but I ran in to an issue on Android.Here is my initialization:
`$(“#jqxdatetimeinput”).jqxDateTimeInput({
width: ‘148.1px’, height: ‘32.2px’, theme: ‘energyblue’, allowNullDate: true,
placeHolder: $(“.jqxDatePH”).text().trim(), formatString: $(“.jqxDateFS”).text().trim()
}) .on(‘change’, function (event) {
validateBirthDateJQ(false);
});
var Culture = $(“.jqxDateCulture”).text().trim();
if (Culture) $(“#jqxdatetimeinput”).jqxDateTimeInput({ culture: Culture });$(“#jqxdatetimeinput”).val(null);`
In the locale I use for testing is “nl-NL” and the formatString = “dd-mm-yyyy”.
This works fine in Chrome, even in developer device mode, but it does not work on my Android phone. When providing input, it does not jump to the next part of the date, I need to provide the “-” manually, or else the date is entered like “10021980”. When you click the Calendar, it shows the current date rather than the date typed in.Please help, what I am doing wrong?
Thanks, Pieter
Typo in the text above, the formatString I am using is “dd-MM-yyyy”.
I made a simple test page here http://www.testme.nl/datetime.html
It works with Chrome on my PC, on IOS 9 and with the native Internet browser on Android 5 and Android 6. It does not work with Chrome on Android 5 and 6.
“Not working” means it does not move to the next date part when one part is entered, and it does not return the entered value. When you enter a date with the keyboard, and then click on the calendar, the current day is displayed in the input field and calendar.
Hi Pietervk,
In your code you use it like that:
$(document).ready(function () { $("#jqxdatetimeinput").jqxDateTimeInput({ width: '148', height: '32', }) }).on('change', function (event) { var jsDate = event.args.date; var type = event.args.type; // keyboard, mouse or null depending on how the date was selected. alert(type + " " + jsDate.toLocaleString() + " " + $('#jqxdatetimeinput').jqxDateTimeInput('getDate')); });
You should check whether “args” is defined. “change” is event which could be raised from the HTML Input element instead of jqxDateTimeInput which means that it is possible event.args to be undefined and that is the reason why you get an exception which states that. After you fix this in your code, it will be ok.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks for looking into this Peter. I removed the on(‘change’ part because it was distracting from the real issue.
When you try the page now on an Android device with Chrome you see what I am trying to say: the input is working as a text inbox rather than a formatted date input, and the date is not gathered from the keyboard input.Can you have another look please?
Pieter
Hi Pieter,
I don’t see a problem when I open it with Chrome on Android. I can type and change the date without a probelm. May be you should clear your history and reload the page. I used for testing Android 6(6.12.401.4) and my device Chrome version is 47.0.2526.83. Our statemenet is: We cannot reproduce this.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I cleared the cache and tried again, with no change. I can’t provide a solution to my customer that does not work on some Androids. To help with the reproduction, I made a little movie:In the first part you can clearly see that the input does not work formatted: typing continues well beyond the first entry. Secondly, I changed the year by tapping it and changing. Then pressed the calendar, and you can see that the typed in date is not used.
My device chrome is 48.0.2564.95, Android 6.12.401.4 on HTC one M8.
Thanks for not giving up on me
Pieter
Hi Pieter,
I updated the device’s browser to 48.0.2564.95, the device is actually the same which is coincidence – HTML One_M8 Build/MRA58K. I still cannot see an issue with this widget.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.