[Deprecated as of 04/03/2017]
Simple Date-Time picker for autoform
- datetimepicker which can be installed with
meteor add drewy:datetimepicker
- autoform
Simply add type='datetimepicker' to your afQuickField
{{#autoForm id='assignmentForm' collection='Posts' type='method' meteormethod='addPost'}}
{{> afQuickField name='date' type='datetimepicker'}}
<button type="submit">Submit</button>
{{/autoForm}}
Or you could optionally set datetimepicker as the default type in your schema
Schema.Date = new SimpleSchema({
date: {
type: String,
autoForm: {
afFieldInput: {
type: "datetimepicker",
}
}
}
});
You can also pass in options for datetimepicker (see datetimepicker docs for more info)
Template.name.helpers({
pickerOpts: function () {
return {
step: 15, //time step in minutes
theme: 'dark',
}
}
});
{{#autoForm id='assignmentForm' collection='Posts' type='method' meteormethod='addPost'}}
{{> afQuickField name='date' type='datetimepicker' opts=pickerOpts}}
<button type="submit">Submit</button>
{{/autoForm}}