Skip to content

drew-y/meteor-autoform-datetimepicker

Repository files navigation

[Deprecated as of 04/03/2017]

screenshot

Simple Date-Time picker for autoform

Installation

Prerequisites

Usage

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}}

Releases

No releases published

Packages

No packages published