如何实现Android的cordova-plugin-datepicker?

Euw*_*uwo 5 android datepicker datetimepicker timepicker cordova

我试图实现这个Datetimepicker(https://github.com/VitaliiBlagodir/cordova-plugin-datepicker),但仍然无法在我的Android设备上运行(Android 4.0.4).

  1. 我将插件添加到我的项目并使用:cordova插件添加https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.

  2. 将触发器放入我的js文件并尝试测试警报("测试").我在浏览器和设备上收到测试警报,但没有来自Datetimepicker的警报?

  3. 我也从平台安装Android并再次构建它,一切都在那里,但仍然无法正常工作.(要构建应用程序,我正在使用PhoneGap Build)

  4. 我不知道我错过了什么?.... 你能帮忙的话,我会很高兴 :-).


例:

在Html中

<input type="text"  onclick="calendar()" />
Run Code Online (Sandbox Code Playgroud)

在JS中

<script>

function calendar(){

  alert("test")  //  is working

  var options = {
    date: new Date(),
    mode: 'date'
  };

  datePicker.show(options, function(date){
   alert("date result " + date);     // not working
  });

}

</script>
Run Code Online (Sandbox Code Playgroud)

Ale*_*ste 0

您是否将脚本包含在 HTML 中?

<script src="your/path/DatePicker.js"></script>
Run Code Online (Sandbox Code Playgroud)