Skip to content

Input type for AutoForm supporting Tempus Dominus datetime picker

Notifications You must be signed in to change notification settings

polygonwood/meteor-autoform-td

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Input type for AutoForm for Tempus Dominus datetime picker [https://github.com/Eonasdan/tempus-dominus]

Example usage in Schema declaration :

  birthday: {
    type: Date,
    optional: true,
    label: 'Birthday',
    autoform: {
      type: 'tempusdominus',
      readonly: false,
      dateTimePickerOptions: {
        defaultDate: DateTime.fromFormat('2000-01-01', 'yyyy-MM-dd').toJSDate(),
        display: {
          sideBySide: false,
          components: {
            decades: true,
            year: true,
            month: true,
            date: true,
            hours: false,
            minutes: false,
            seconds: false
          },
          viewMode: 'years',
          inline: false
        }
      },
      localization: {
        locale: 'en-GB', // should be set already on TempusDominus level
        format: 'LL' // choose the format you want to display in the input field (formats predefined in TempusDominus)
      }
    }
  }

The package uses a global.pickers variable to keep track of active DateTime picker instances to retrieve value in valueOut function. This implementation assumes that you have a global variabel TempusDominus at the start of the application. See TempusDominus documentation for setup of default options and localization.

About

Input type for AutoForm supporting Tempus Dominus datetime picker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published