Date disappears if you use bootstrap compilation

Pull a working example from github, dateExample .

I asked this question before this suggestion didn't work, so I created a small working example. If someone can point me in the right direction, I can post it online and post the link here. This is a meteorite app.

Problem

Autoform generates a date form. The form works like an array and uses a bootstrap template that provides some +- buttons +- to add or remove additional entries. When I use aldeed:autoform-bs-datepicker , a strange problem appears on the form. If you enter a date and press the +- button before saving, the dates will disappear. If you do not use autoform-bs-datepicker , this problem will go away.

See the code below, if there is a way to post the example on the Internet, let me know and I will.

Path: packages.js

 twbs:bootstrap aldeed:collection2 aldeed:autoform rajit:bootstrap3-datepicker aldeed:autoform-bs-datepicker 

Path: Schemas.js

 Classes = new Mongo.Collection("Classes"); var Schemas = {}; Schemas.DatesNotWorking = new SimpleSchema({ name: { type: String, optional: true }, startDate: { type: Date, optional: true, autoform: { type: "bootstrap-datepicker", "data-date-autoclose": "true", datePickerOptions: { format: "yyyy", startView: "years", minViewMode: "years" } } }, endDate: { type: Date, optional: true, autoform: { type: "bootstrap-datepicker", "data-date-autoclose": "true", datePickerOptions: { format: "yyyy", startView: "years", minViewMode: "years" } } } }); Schemas.DatesWorking = new SimpleSchema({ name: { type: String, optional: true }, startDate: { type: Date, optional: true }, endDate: { type: Date, optional: true } }); Schemas.Subjects = new SimpleSchema ({ datesNotWorking: { type: [Schemas.DatesNotWorking], optional: true }, datesWorking: { type: [Schemas.DatesWorking], optional: true } }); Classes.attachSchema(Schemas.Subjects); 

Path: dateExample.html

 <head> <title>dateExample</title> </head> <body> {{> dateExampleNotWorking}} {{> dateExampleWorking}} </body> <template name="dateExampleNotWorking"> {{#autoForm collection="Classes" id="classesForm" type="update"}} {{> afQuickField name='datesNotWorking'}} <button type="submit" class="btn btn-primary submit">Update</button> {{/autoForm}} </template> <template name="dateExampleWorking"> {{#autoForm collection="Classes" id="classesForm" type="update"}} {{> afQuickField name='datesWorking'}} <button type="submit" class="btn btn-primary submit">Update</button> {{/autoForm}} </template> 
+6
source share
1 answer

In packages.js first add jQuery and add rajit:bootstrap3-datepicker

 twbs:bootstrap aldeed:collection2 aldeed:autoform jquery rajit:bootstrap3-datepicker aldeed:autoform-bs-datepicker 
0
source

All Articles