Translated from: http://blog.chinaunix.net/uid-20332519-id-5733546.html
Bootstrap DateTimePicker has multiple versions, the official link, just datepicker, no time to choose, the original DateTimePicker is no longer updated, can not use the new version of jquery.
Now Https://github.com/Eonasdan/bootstrap-datetimepicker This version is the most perfect, but a lot of dependence is very headache;
Https://github.com/smalot/bootstrap-datetimepicker is also good, relatively light, but use up error.
Error:
TypeError: (intermediate value). toString (...). Split (...) [1 is undefined ... d"? false:k.title;this.defaulttimezone= (New Date ()) . toString (). Split ("(
Original:
this. defaulttimezone= (new Date ()). ToString (). Split ("(") [1].slice (0,-1);
Get the Date object first, then the string, then use (to separate the string, then take the second one, and then from right to left to take the first item, that is, take the time zone entry.
However, in Firefox, the result of the string is: "Wed may 16:07:14 gmt+0800", without parentheses, resulting in an error.
More general, the time zone can be obtained with getTimezoneOffset(), the unit of the result is minutes, so divide by 60 to:
Modified to:
this. defaulttimezone= ' GMT ' + (new Date ()). getTimezoneOffset ()/60
After the modification, it can be used normally.
this. fontawesome=k.fontawesome| | this. Element.data ("Font-awesome") | | false;
Switch
this. Fontawesome=true
There is also a font error, if the use of FA font, will be error, the system will not detect fontawesome, so you can directly assign this variable to true:
Bootstap DateTimePicker Error Typeerror:intermediate value (RPM)