# Angular Material DateTimePicker

Originally designed for Bootstrap Material, this has been modified to work with [Angular Material](https://material.angularjs.org/). This is an Android style date-time picker for Angular Material. Some added features include:

- Double click to select date or time
- Swipe left to go to next month or Swipe right to go to previous month.

### Dependencies

Depends on the following library:

- Angular Material & it's dependencies
- Angular Touch
- Moment

## Installing via Bower

```
bower install angular-material-datetimepicker
```


## Live Example

Click [here](http://logbon72.github.io/angular-material-datetimepicker) to see live examples.

## Usage

Add the plugin module as a dependency to your AngularJS module:

```js
    angular.module('myAwesomeModule', [
      //other dependencies ignored
      'ngMaterialDatePicker'
    ]);
```

This plugin exposes a directive which should be used as an attribute for an input element. The directive is
`mdc-datetime-picker`. An example of this is given below:

```html
    <md-input-container flex-gt-md="30">
        <label>Timepicker Only</label>
        <input mdc-datetime-picker date="false" time="true" type="text" id="time" short-time="true"
               placeholder="Time"
               min-date="minDate"
               format="hh:mm a"
               ng-model="time">
    </md-input-container>
```


### Directive Attributes

The directive accepts several attributes which are described below:

| Name				| Type							| Description									|
| ----------------- | ----------------------------- | --------------------------------------------- |
| **ng-model**	    | (String Date Moment)		| Initial Date or model to assign the date to|
| **format**		| String						| [MomentJS Format](momentjs.com/docs/#/parsing/string-format/),defaults to `HH:mm` for time picker only, `YYYY-MM-DD` for date picker only and `YYYY-MM-DD HH:mm` for both timepicker and date picker |
| **short-time**	| Boolean						| true => Display 12 hours AM\|PM 				|
| **min-date**		| (String Date Moment)		| Minimum selectable date						|
| **max-date**    | (String Date Moment)    | Maximum selectable date           |
| **start-week**		| (String)		| First day of week (default 1 : Monday)						|
| **date**			| Boolean						| true => Has Datepicker (default: true)        |
| **time**			| Boolean						| true => Has Timepicker (default: true)		|
| **cancel-text**	| String						| Text for the cancel button (default: Cancel)	|
| **ok-text**   | String            | Text for the OK button (default: OK)      |
| **ng-change**		| 						| 			|

