我目前正在使用JQuery的Date time picker,但它没有使用给定的格式。它使用它的默认日期格式而不是使用它,并在控制台中给出错误: persons_profile = []
for i, item in enumerate(persons):
persons_profile .append(item)
if(persons_profile [0] == 'Person 1'):
person_id = persons_profile [0]
person_age = persons_profile [1]
person_country = persons_profile [2]
person_color = persons_profile [3]
print "Person id", persons_profile [O]
some_function()
elif(persons_profile [0] == 'Person 2'):
person_id = persons_profile [0]
person_age = persons_profile [1]
person_country = persons_profile [2]
person_color = persons_profile [3]
print "Person id", persons_profile [O]
some_function()
elif(persons_profile [0] == 'Person 3'):
person_id = persons_profile [0]
person_age = persons_profile [1]
person_country = persons_profile [2]
person_color = persons_profile [3]
print "Person id", persons_profile [O]
some_function()
elif(persons_profile [0] == 'Person 4'):
person_id = persons_profile [0]
person_age = persons_profile [1]
person_country = persons_profile [2]
person_color = persons_profile [3]
print "Person id", persons_profile [O]
some_function()
else:
print "NOT FOUND!"
。当我失去日期时间选择器的焦点时,我收到此错误。
有些东西,我在页面加载后立即收到另一个错误:Uncaught TypeError: F.mask.replace is not a function
。
如何确保它使用给定的格式?
如果您需要任何其他信息,请随时提出。
HTML
maximum call stack size exceeded
CSS
<input id="start" value="01-01-2016" />
其他信息
This是我使用的日期时间选择器代码。错误($('#start').datetimepicker({
formatTime: 'H:i',
formatDate: 'dd-mm-yy',
defaultDate: '01-01-2016',
defaultTime: '10:00'
});
)位于第1743行。
答案 0 :(得分:1)
这是主分支中的错误。它是already fixed,但仍存在于连接文件jquery.datetimepicker.full.js中。如果您不想使用此release versions,则可以使用文件jquery.datetimepicker.js并添加所需的依赖项:
如果您使用bower,您可以将此处的https://github.com/xdan/datetimepicker/blob/master/bower.json依赖项添加到您自己的bower.json中:
"jquery": ">= 1.7.2",
"jquery-mousewheel": ">= 3.1.13",
"php-date-formatter": ">= 1.3.3"
或:
<link href="https://rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.css" type="text/css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
<script src="https://rawgit.com/jquery/jquery-mousewheel/master/jquery.mousewheel.min.js"></script>
<script src="https://rawgit.com/kartik-v/php-date-formatter/master/js/php-date-formatter.min.js"></script>
<script src="https://rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.js"></script>
<input id="start" value="01-01-2016" />
<script>
$( document ).ready(function() {
$('#start').datetimepicker({
formatTime: 'H:i',
formatDate: 'dd-mm-yy',
defaultDate: new Date(2016,01,01),
defaultTime: '10:00'
});
});
</script>