minDate在datetimepicker库上不起作用

时间:2019-03-20 12:52:47

标签: javascript php datetimepicker

我将datetimepicker插件用于datepicker。我想从今天起隐藏过去的日期,但请注意,该方法不起作用。我这样使用:

$('.datetimepicker7').datetimepicker({
   onChangeDateTime:logic,
   onShow:logic,
   format:'d/m/Y',
   formatDate:'d/m/Y',
   timepicker:false,
   minDate: +1, // here i use minDate but this is not working
   theme:'dark'
});

在日期选择器框中可以看到过去的图像:

enter image description here

2 个答案:

答案 0 :(得分:0)

在这里,我使用以下方法解决了该问题:

var tday = new Date();

$('.datetimepicker7').datetimepicker({
  onChangeDateTime:logic,
  onShow:logic,
  format:'d/m/Y',
  formatDate:'d/m/Y',
  timepicker:false,
  minDate: tday,
  theme:'dark'
});

答案 1 :(得分:0)

请尝试以下解决方案:

MyWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
MyWebviewSettings.setJavaScriptEnabled(true);

myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.getSettings().setAllowFileAccessFromFileURLs(true);
myWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);