1.1.7 • Published 6 years ago

ember-material-design-datepicker v1.1.7

Weekly downloads
65
License
Unlicensed
Repository
github
Last release
6 years ago

Ember-material-design-datepicker

Build Status Code Climate

This project aims to bring an easy to use Material Design themed datepicker to Ember.

Installation

Install the ember-cli addon in your ember-cli project:

$ ember install ember-material-design-datepicker

This should also automatically create an scss file under app/styles/app.scss with @import 'ember-material-design-datepicker'; and install ember-cli-sass.

Sass is required for this addon. There are a number of sass variables that can easily be overidden to change the default styling of Ember-material-design-datepicker, these are detailed in usage below.

Usage

Options

  • dateChanged (required) - When the user selects a new date, or edits the date's text, this action is fired with the new date as the first argument. If the date is deemed invalid then 'null' is sent. The second argument is a bool indicating whether the date was entered was valid or not. In most circumstances your application should consume this action and update selectedDate.
  • selectedDate (optional) - The date that should currently be selected
  • mode (optional) - 'date' or 'datetime' can be set. Defaults to 'date'.
  • dateFormat (optional) - Allows the format of the date's text to be changed. Defaults to MM/DD/YYYY.
  • timeFormat (Optional) Sets the format of the time. Defaults to 'HH:mm' (Uppercase HH for 24hour clock. lowercase for 12hour).
  • required (optional) - Passed onto the input element and used when validating. Defaults to false.
  • disabled (optional) - Passed onto the input element. When true it prevents the date from being changed. Defaults to false.
  • placeholder (optional) - The text to display above the date's text.
  • relaxValidation (optional) - When set to true this turns off the 'use strict mode' option within Moment.js when validating the date's text. Defaults to false.
  • inputClass (optional) - Passed directly onto the input element as its class attribute.
  • name (optional) - Passed directly onto the input element.
  • errorMessage (optional) - When provided an error message can be displayed below the input element.
  • minDate (optional) - When provided this prevents the user from selecting a date earlier than this. It is also used when validating the date's text.
  • maxDate (optional) - When provided this prevents the user from selecting a date after this. It is also used when validating the date's text.
  • utc (optional) - When true dates are parsed in UTC. Defaults to false where local time is then used.
  • hourOffset (optional) - When provided, dates selected or entered will apply this offset from midnight.
  • autoHideAfterSelection (optional) - Default: true. When false, the datepicker remains on display after selecting date.
  • locale (optional) - Default: 'en'. Sets component's locale. See moment.js instance locales.
  • dropUp (optional) - Default: false. Causes the control to drop up when true. Drops down by default/when false.

Sass variables

A number of sass variables can be overridden by your application See the top of ember-material-design-datepicker.scss.

Collaborating

We welcome pull requests. For enhancements we suggest you open an issue first, and then if accepted volunteer to take on the feature yourself.

Styling

We use Eslint to enforce styling. We aim to match Ember Styling Guide but this is a work in progress.

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

1.1.7

6 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago