引用Bootstrap 3 Datepicker插件时出现以下错误:
Uncaught bootstrap-datetimepicker requires Moment.js to bootstrap-datetimepicker.js:49 be loaded first
Uncaught bootstrap-datetimepicker requires Moment.js_bootstrap
解决方案:
在使用bootstrap-datetimepicker相关函数时,先引入moment.js这个文件。
https://github.com/moment/moment/
下载,加入相应的js文件到项目中:
Uncaught bootstrap-datetimepicker requires Moment.js_datepicker_02
在BundleConfig.cs类中添加打包压缩:
Uncaught bootstrap-datetimepicker requires Moment.js_Java_03
实现效果:
Uncaught bootstrap-datetimepicker requires Moment.js_bootstrap_04