176
rated 0 times
[
179]
[
3]
/ answers: 1 / hits: 30899
/ 11 Years ago, fri, june 21, 2013, 12:00:00
I have tried to implement the date picker in android. I want it to get the data and show it in the text format
<html>
<head>
<script type=text/javascript charset=utf-8 src=cordova-2.5.0.js></script>
<script type=text/javascript charset=utf-8 src=datePickerPlugin.js></script>
<script type=text/javascript charset=utf-8>
function dateTest() {
var myNewDate = new Date();
window.plugins.datePicker.show({
date : myNewDate,
mode : 'date', // date or time or blank for both
allowOldDates : true
}, function(returnDate) {
var newDate = new Date(returnDate);
currentField.val(newDate.toString(dd/MMM/yyyy));
// This fixes the problem you mention at the bottom of this script with it not working a second/third time around, because it is in focus.
currentField.blur();
});
}
</script>
</head>
<body bgcolor=#ffffff>
<hr>DatePicker Test<hr><br>
<input type=button onClick =dateTest() value =Today's Date!! />
<div id=view></div>
</body>
</html>
I am getting it as an alert...but unable to store it as a string on the same page
More From » android