Datepicker多个日期在Google Apps脚本中无法使用 [英] Datepicker Multiple Dates not working in Google Apps Script
问题描述
我正在尝试创建一个允许用户选择多个日期的日期戳。这些是我使用的JavaScript和样式表引用:
I am trying to create a datepicker that allows users to select multiple dates. These are the javascript and stylesheet references I am using:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://multidatespickr.sourceforge.net/jquery-ui.multidatespicker.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" />
这是我准备好的文件后调用的函数:
This is the function I am calling once the document is ready:
try{
$("#recievedInHouseDate").multiDatesPicker();
}catch(e){
alert(e)
};
我得到的警报是:TypeError:$(...)。multiDatesPicker不是一个函数
And the alert I get is: TypeError: $(...).multiDatesPicker is not a function
任何想法为什么这不行。
Any idea why this wouldn't work. I can get the regular date picker working fine if I only want to select a single date.
推荐答案
为什么要导入jquery- ui两次?
Why do you import jquery-ui twice?
这里:
script src =// ajax。 googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js> / script
script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js">/script
此处:
脚本src =http://code.jquery.com/ui/1.10.3/jquery-ui.js> / script
script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js">/script
我想你应该删除其中的一个。至少在我的情况下,引起了类似于Datepicker的问题。
I think you should remove one of them. At least in my case that caused a similar to yours problem with Datepicker.
这篇关于Datepicker多个日期在Google Apps脚本中无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!