All Projects → Meteor-Community-Packages → meteor-autoform-bs-datetimepicker

Meteor-Community-Packages / meteor-autoform-bs-datetimepicker

Licence: MIT license
Custom bootstrap-datetimepicker input type with timezone support for AutoForm

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to meteor-autoform-bs-datetimepicker

Meteor Autoform
AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
Stars: ✭ 1,453 (+7972.22%)
Mutual labels:  meteor, autoform, blaze
meteor-video-chat
Simple id based video calling in meteor
Stars: ✭ 33 (+83.33%)
Mutual labels:  meteor, blaze
meteor-autoform-materialize
DEPRECATED - Meteor AutoForm Materialize templates
Stars: ✭ 48 (+166.67%)
Mutual labels:  meteor, autoform
blaze-magic-events
A new way of binding event handlers to html elements for Meteor's Blaze.
Stars: ✭ 26 (+44.44%)
Mutual labels:  meteor, blaze
MeteorCandy-meteor-admin-dashboard-devtool
The Fast, Secure and Scalable Admin Panel / Dashboard for Meteor.js
Stars: ✭ 50 (+177.78%)
Mutual labels:  meteor, blaze
awesome-blaze
🔥A curated list of awesome things related to Blaze
Stars: ✭ 29 (+61.11%)
Mutual labels:  meteor, blaze
fragments
Organise your bookmarks into boards
Stars: ✭ 56 (+211.11%)
Mutual labels:  meteor, blaze
blaze-integration
Vue integration with Meteor's Blaze rendering engine.
Stars: ✭ 24 (+33.33%)
Mutual labels:  meteor, blaze
meteor-autoform-bs-datepicker
Custom "bootstrap-datepicker" input type for AutoForm
Stars: ✭ 25 (+38.89%)
Mutual labels:  meteor, autoform
meteor-blaze-bs4
Generic Bootstrap 4 components library for Meteor Blaze.
Stars: ✭ 20 (+11.11%)
Mutual labels:  meteor, blaze
unity3d-ddp-client
Lightweight DDP client for Unity3D
Stars: ✭ 18 (+0%)
Mutual labels:  meteor
Meteor-logger-file
🔖 Meteor Logging: Store application log messages into file (FS)
Stars: ✭ 24 (+33.33%)
Mutual labels:  meteor
meteor-reactive-mongo
Reactive server-side MongoDB queries
Stars: ✭ 14 (-22.22%)
Mutual labels:  meteor
URT
Fast Unit Root Tests and OLS regression in C++ with wrappers for R and Python
Stars: ✭ 70 (+288.89%)
Mutual labels:  blaze
awesome-vulcan
🗒 A list of resources to learn awesome VulcanJS 🖖
Stars: ✭ 15 (-16.67%)
Mutual labels:  meteor
signmeup
Real-time application to sign up for and manage TA hours.
Stars: ✭ 97 (+438.89%)
Mutual labels:  meteor
meteorpp
Meteor DDP & Minimongo implementation in C++.
Stars: ✭ 22 (+22.22%)
Mutual labels:  meteor
Client-Storage
🗄 Bulletproof persistent Client storage, works with disabled Cookies and/or localStorage
Stars: ✭ 15 (-16.67%)
Mutual labels:  meteor
Grow-IoT
Software packages for smart growing environments.
Stars: ✭ 24 (+33.33%)
Mutual labels:  meteor
Block-Farm
A farming game built upon Ethereum platform.
Stars: ✭ 60 (+233.33%)
Mutual labels:  meteor

aldeed:autoform-bs-datetimepicker

IMPORTANT: This repo is no longer maintained (but may still work for you). You can find forks and other alternatives that work better on Atmosphere.

An add-on Meteor package for aldeed:autoform. Provides a single custom input type, "bootstrap-datetimepicker", which renders an input using the bootstrap-datetimepicker plugin.

Prerequisites

Bootstrap and the plugin library must be installed separately.

In a Meteor app directory, enter:

$ meteor add twbs:bootstrap
$ meteor add tsega:bootstrap3-datetimepicker@=3.1.3_3
$ meteor add aldeed:autoform

If you need to use the timezoneId attribute to get the Date in some timezone other than the local client timezone, you must also add moment-timezone:

$ meteor add risul:moment-timezone

Or install and import the NPM package.

Installation

In a Meteor app directory, enter:

$ meteor add aldeed:autoform-bs-datetimepicker

Usage

Specify "bootstrap-datetimepicker" for the type attribute of any input. This can be done in a number of ways:

In the schema, which will then work with a quickForm or afQuickFields:

{
  date: {
    type: Date,
    autoform: {
      afFieldInput: {
        type: "bootstrap-datetimepicker",
        dateTimePickerOptions: {}
      }
    }
  }
}

Or on the afFieldInput component or any component that passes along attributes to afFieldInput:

{{> afQuickField name="typeTest" type="bootstrap-datetimepicker"}}

{{> afFormGroup name="typeTest" type="bootstrap-datetimepicker"}}

{{> afFieldInput name="typeTest" type="bootstrap-datetimepicker"}}

Choosing a Timezone

By default, the field's value will be a Date object representing the selected date and time in the browser's timezone (i.e., based on the user's computer time settings). In most cases, you probably want the Date object relative to some other timezone that you have previously stored. For example, if the form is setting the start date of an event, you want the date to be relative to the event venue's timezone. You can specify a different IANA timezone ID by adding a timezoneId attribute.

{
  date: {
    type: Date,
    autoform: {
      afFieldInput: {
        type: "bootstrap-datetimepicker",
        timezoneId: "America/New_York"
      }
    }
  }
}

Or:

{{> afFieldInput name="typeTest" type="bootstrap-datetimepicker" timezoneId="America/New_York"}}

Automatic Type Conversions

This input type is intended to be used with type: Date schema keys, but it also works with other schema types. Here's a list:

  • Date: Value is stored as a Date object representing the selected date and time in the timezone you specified with the timezoneId attribute. By default, the timezone is that of the browser (i.e., the user's computer time settings).
  • String: Value is stored as a string representation of the selected date in ISO format, e.g., "2014-11-25T00:00:00".
  • Number: Value is stored as the result of calling getTime() on the Date object (representing the selected date and time in the timezone you specified).
  • Array: If the schema expects an array of Date or String or Number, the value is converted to a one-item array and stored.

To provide bootstrap-datetimepicker options, set a dateTimePickerOptions attribute equal to a helper that returns the options object.

Customizing Appearance

If you want to customize the appearance of the input, for example to use an input group with date/time icons, use the aldeed:template-extension package to replace the "afBootstrapDateTimePicker" template, like this:

<template name="dpReplacement">
  <div class='input-group date'>
    <input type="text" value="" {{atts}}/>
    <span class="input-group-addon">
      <span class="glyphicon glyphicon-calendar"></span>
    </span>
  </div>
</template>
Template.dpReplacement.replaces("afBootstrapDateTimePicker");

Contributing

Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].