Bootstap DateTimePicker Error Typeerror:intermediate value (RPM)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.