简体   繁体   English

Bootstrap Timepicker的奇怪问题

[英]Strange Issue With Bootstrap Timepicker

I have a form with a bootstrap timepicker, the form is meant for editing purposes meaning on page load data is loaded from the database to it's respective fields in the form. 我有一个带有引导时间选择器的表单,该表单用于编辑目的,这意味着页面加载数据从数据库加载到表单中的各个字段。 However this works well for all other fields but datepicker and time picker. 但是,这对于除日期选择器和时间选择器以外的所有其他字段都适用。 The value itself changes when you look at the page source, but the value in the page source is different than what is actually showing on the page: 当您查看页面源时,值本身会更改,但是页面源中的值与页面上实际显示的值不同:

Inspect Element: 检查元素: 在此处输入图片说明

Form Display: 表格显示: 在此处输入图片说明

What i noticed is that the actual value form the database is displayed on page load but then it changes by itself as soon as the page is done loading which is making me believe there is some javascript that is responsible for this bad behaviour. 我注意到的是,数据库的实际值是在页面加载时显示的,但是一旦页面加载完成,它就会自行更改,这使我相信有些JavaScript会导致这种不良行为。

You have to set the time in another format. 您必须以其他格式设置时间。

If it is this component: http://jdewit.github.io/bootstrap-timepicker/ , you must set it like this: 02:00 PM 如果是此组件: http : //jdewit.github.io/bootstrap-timepicker/ ,则必须这样设置: 02:00 PM : 02:00 PM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM