Javascript 如何修复';dtp.setDate';Meteor自动格式日期时间选择器出错?
我试图使用这个自动表单包,但当我尝试自己的代码时,出现了这个错误Javascript 如何修复';dtp.setDate';Meteor自动格式日期时间选择器出错?,javascript,twitter-bootstrap,meteor,datetimepicker,meteor-autoform,Javascript,Twitter Bootstrap,Meteor,Datetimepicker,Meteor Autoform,我试图使用这个自动表单包,但当我尝试自己的代码时,出现了这个错误 TypeError: dtp.setDate is not a function at null.<anonymous> (aldeed_autoform-bs-datetimepicker.js:141) at view.js:199 at Function.Template._withTemplateInstanceFunc (template.js:457) at view.js:197 at Object.Bl
TypeError: dtp.setDate is not a function
at null.<anonymous> (aldeed_autoform-bs-datetimepicker.js:141)
at view.js:199
at Function.Template._withTemplateInstanceFunc (template.js:457)
at view.js:197
at Object.Blaze._withCurrentView (view.js:538)
at viewAutorun (view.js:196)
at Tracker.Computation._compute (tracker.js:323)
at new Tracker.Computation (tracker.js:211)
at Object.Tracker.autorun (tracker.js:562)
at Blaze.View.autorun (view.js:209)
我遵循了在中给出的说明,并在Meteor项目中添加了aldeed:autoform bs datetimepicker
和tsega:bootstrap3 datetimepicker
。这是4.x.x版本中的一个示例。您可以通过降级到版本3.1.3_3来修复此错误
要安装版本为3.1.3_3的软件包,请运行以下命令:
meteor add tsega:bootstrap3-datetimepicker@=3.1.3_3
您可能还想安装软件包以获得完全的引导支持。这严重破坏了datetimepicker的css。@LeQs真的吗?你使用哪个版本?刚降级到3.1.3_3@LeQs好的,你使用这个软件包吗?我设法解决了这个问题。如果小部件不像我的情况那样长,只需覆盖小部件宽度
。bootstrap datetimepicker小部件{width:300px!important;}
Tests = new Mongo.Collection("tests");
TestsSchema = new SimpleSchema({
typeTest: {
type: Date,
optional: true,
autoform: {
afFieldInput: {
type: "bootstrap-datetimepicker"
}
}
}
});
Tests.attachSchema(TestsSchema);
meteor add tsega:bootstrap3-datetimepicker@=3.1.3_3