Updating data(date) with packages"aldeed:autoform, tsega:bootstrap3-datetimepicker aldeed:autoform-bs-datetimepicker, mrt:moment-timezone"

Hi I have a problem with displaying dates entered in the database to be updated.
The data entered by means of such a package, “aldeed:autoform, tsega:bootstrap3-datetimepicker aldeed:autoform-bs-datetimepicker, mrt:moment-timezone”

Dates stored in the database:
"start" : ISODate("2016-01-29T08:32:00Z"), "end" : ISODate("2016-01-29T09:32:00Z"),

Dates are recorded on the basis of SimpleSchema:
start: { type: Date, label: "Data utworznie wydarzenia", autoform: { afFieldInput: { type: "bootstrap-datetimepicker", timezoneId: "Europe/Berlin" } } }, end: { type: Date, label: "Data zakończenia wydarzenia", autoform: { afFieldInput: { type: "bootstrap-datetimepicker", timezoneId: "Europe/Berlin" } } },

To update the data in the template I used the following code:
{{> quickForm collection="Wydarzenia" id="edacja-wydarzenia" type="update" doc=wydarzenie }}

I also tried to display data using this code:
{{#autoForm collection="Wydarzenia" id="eydcja-wydarzenia" type="update" class="eydcja-wydarzenia" doc=wydarzenie}} <fieldset> <div class="row"> <div class="col-md-3"> <div class="eydcja-wydarzenia-start-date form-group"> {{> afQuickField name="start" type="bootstrap-datetimepicker" timezoneId="Europe/Berlin"}} <span class="help-block hide"></span> </div> </div> <div class="col-md-3"> <div class="eydcja-wydarzenia-end-date form-group"> {{> afQuickField name="end" type="bootstrap-datetimepicker" timezoneId="Europe/Berlin"}} <span class="help-block hide"></span> </div> </div> </div> </fieldset> <div class="row"> <div class="col-xs-2 col-md-2 pull-right"> <button type="submit" class="btn btn-success btn-block btn-flat" value="Zapisz wydarzenie">Zapisz wydarzenie</button> </div> </div> {{/autoForm}}

Javascript code that handles data display:
`Template.wydarzenie.onCreated(function () {
var self = this;
self.autorun(function () {
var id = FlowRouter.getParam(‘id’);
self.subscribe(‘singleWydarzenie’, id);
})
});

Template.wydarzenie.helpers({
wydarzenie: ()=> {
var id = FlowRouter.getParam(‘id’);
return Wydarzenia.findOne({_id: id});
}
});`

In none of the cases do not appear to date to not display. Does anyone know where I make a mistake and how to fix it to the date displayed the form to update the data after the package “aldeed:autoform”

What is your issue? Not displaying the date?

When I start editing the post with a code:
{{> quickForm collection="Wydarzenia" id="edacja-wydarzenia" type="update" doc=wydarzenie }}
or other solution that placed above.

The browser displays all the data belonging to this post (tag html “input”):
<input type = "text" name = "title" id = "D49NniLHrbt2kskAy" required = "" data-schema-key = "title" maxlength = "200" class = "form-control">

The tag for the display of dates is as follows:
<input type = "text">

If you’re using {{ #autoform }} block you don’t need to set the type on the template if you already declared it in your schema,

try this on your schema

start: {
  type: Date,
  label: "Data utworznie wydarzenia",
  autoform: {
    type: "bootstrap-datetimepicker",
    timezoneId: "Europe/Berlin",
    'formgroup-class': 'col-md-3'
  }
},
end: {
  type: Date,
  label: "Data utworznie wydarzenia",
  autoform: {
    type: "bootstrap-datetimepicker",
    timezoneId: "Europe/Berlin",
    'formgroup-class': 'col-md-3'
  }
},

on your template
if you’re using {{#autoform}} block, try this:

{{#autoForm collection="Wydarzenia" doc=item id="eydcja-wydarzenia" type="update" class="eydcja-wydarzenia" }}
  {{> afQuickField name="start"}}
  {{> afQuickField name="end"}}
  <div class="row">
    <div class="col-xs-2 col-md-2 pull-right">
    <button type="submit" class="btn btn-success btn-block btn-flat" value="Zapisz wydarzenie">Zapisz wydarzenie</button>
    </div>
  </div>
{{/autoform}}

Try the above approach, i’m not sure about flow router, i haven’t used it yet but I think i will work since you need the id of the document if you want to update it.

Let me know if this solves your problem.

I’m sorry but it is not working. I will remove the package “aldeed: autoform” and do it manually. Thanks for the help

Did you see the date is stored on your db?

Where exactly on your app the date did not displayed? Creation of documents after you’ve picked a date?

An update scenario?

or

On a table?

The problem lies in the package “aldeed:autoform-bs-datetimepicker” changed to a different package:
“rajit:bootstrap3-datepicker” and “aldeed:autoform-bs-datepicker” and everything is working properly.

But I have another problem in the package ““rajit:bootstrap3-datepicker”” only displays the date as day, month and year.
There is no possibility to select the hours and minutes - what I really care about. Each forgive myself and I do everything by introducing its own code

No need to install rajit:bootstrap-datepicker, it displays only day, month and year, as mentioned here, and you already have the three packages.

Clean up your packages and try it again. Breathe deeply and clear your mind.

:+1: