|
2 | 2 |
|
3 | 3 | 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:
|
4 | 4 |
|
5 |
| -- Double click to select date or time |
6 |
| -- Swipe left to go to next month or Swipe right to go to previous month. |
| 5 | +- Double or single click to select date and/or time |
| 6 | +- Swipe left to go to next month or Swipe right to go to previous month |
| 7 | +- Configurable first day of the week |
| 8 | +- Support 24 hours format display |
| 9 | +- Can disable dates, not selectable by user |
| 10 | +- Can disable minutes view |
| 11 | +- Compatible with right-to-left direction |
7 | 12 |
|
8 | 13 | ## Updates
|
9 | 14 |
|
10 |
| -** I have kept this section of the document as an acknowledgement for all the work done on the original Bootstrap Material plugin ** |
11 |
| - |
12 |
| -| Date | Author | Description | |
13 |
| -| ----------------- | ----------------- | ------------------------------------------------------ | |
14 |
| -| 2017-01-30 | hexadecy | Add support only for angular 1.5.x - 1.6.x ($onInit) | |
15 |
| -| 2015-11-12 | logbon72 | Adapted plugin for Angular Material | |
16 |
| -| 2015-10-19 | benletchford | Fixed not being able to tab into input | |
17 |
| -| 2015-10-19 | drblue | Fixed erroneous package.json-file | |
18 |
| -| 2015-10-19 | Perdona | Fix auto resize when month has 6 weeks | |
19 |
| -| 2015-07-01 | T00rk | Redesigned element without using modal | |
20 |
| -| 2015-06-16 | T00rk | Use Timepicker alone / Display short time (12 hours) | |
21 |
| -| 2015-06-13 | T00rk | Fixed issue with HTML value tag | |
22 |
| -| 2015-05-25 | T00rk | Changed repo name to bootstrap-material-datetimepicker * | |
23 |
| -| 2015-05-12 | T00rk | Added parameters for button text | |
24 |
| -| 2015-05-05 | Sovanna | FIX undefined _minDate in isBeforeMaxDate func | |
25 |
| -| 2015-04-10 | T00rk | Little change in clock design | |
26 |
| -| 2015-04-10 | Peterzen | Added bower and requirejs support | |
27 |
| -| 2015-04-08 | T00rk | Fixed problem on locale switch | |
28 |
| -| 2015-03-04 | T00rk | Added Time picker | |
| 15 | +| Date | Author | Description | |
| 16 | +| ---------- | -------- | ---------------------------------------------------- | |
| 17 | +| 2017-04-17 | hexadecy | Single click to select | |
| 18 | +| 2017-02-27 | hexadecy | Can hide minutes view, Month next and prev buttons | |
| 19 | +| 2017-02-22 | hexadecy | Fix for rtl website | |
| 20 | +| 2017-02-15 | hexadecy | Fix inputs are not bluring after selection is made | |
| 21 | +| 2017-01-30 | hexadecy | Add support only for angular 1.5.x - 1.6.x ($onInit) | |
| 22 | +| 2015-11-12 | logbon72 | Adapted plugin for Angular Material | |
29 | 23 |
|
30 | 24 | ### Dependencies
|
31 | 25 |
|
@@ -56,15 +50,15 @@ bower install ng-material-datetimepicker
|
56 | 50 |
|
57 | 51 | ## CDN
|
58 | 52 | ```
|
59 |
| -<script src="https://unpkg.com/[email protected].10/dist/angular-material-datetimepicker.min.js"></script> |
60 |
| -<script src="https://unpkg.com/[email protected].10/dist/angular-material-datetimepicker.min.js.map"></script> |
61 |
| -<link href="https://unpkg.com/[email protected].10/dist/material-datetimepicker.min.css rel="stylesheet" type="text/css"> |
| 53 | +<script src="https://unpkg.com/[email protected].12/dist/angular-material-datetimepicker.min.js"></script> |
| 54 | +<script src="https://unpkg.com/[email protected].12/dist/angular-material-datetimepicker.min.js.map"></script> |
| 55 | +<link href="https://unpkg.com/[email protected].12/dist/material-datetimepicker.min.css rel="stylesheet" type="text/css"> |
62 | 56 | ```
|
63 | 57 | or
|
64 | 58 | ```
|
65 |
| -<script src="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.10/dist/angular-material-datetimepicker.min.js"></script> |
66 |
| -<script src="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.10/dist/angular-material-datetimepicker.min.js.map"></script> |
67 |
| -<link href="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.10/dist/material-datetimepicker.min.css" rel="stylesheet" type="text/css"> |
| 59 | +<script src="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.12/dist/angular-material-datetimepicker.min.js"></script> |
| 60 | +<script src="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.12/dist/angular-material-datetimepicker.min.js.map"></script> |
| 61 | +<link href="https://cdn.rawgit.com/beenote/angular-material-datetimepicker/v1.5.12/dist/material-datetimepicker.min.css" rel="stylesheet" type="text/css"> |
68 | 62 | ```
|
69 | 63 |
|
70 | 64 | ## Live Example
|
@@ -103,23 +97,24 @@ This plugin exposes a directive which should be used as an attribute for an inpu
|
103 | 97 |
|
104 | 98 | The directive accepts several attributes which are described below:
|
105 | 99 |
|
106 |
| -| Name | Type | Description | |
107 |
| -| ----------------- | ----------------------------- | --------------------------------------------- | |
108 |
| -| **ng-model** | (String\|Date\|Moment) | Initial Date or model to assign the date to | |
109 |
| -| **ng-change** | Function | A function to call when the input value changes. | |
110 |
| -| **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 | |
111 |
| -| **short-time** | Boolean | true => Display 12 hours AM\|PM (default: false) | |
112 |
| -| **min-date** | (String\|Date\|Moment) | Minimum selectable date | |
113 |
| -| **max-date** | (String\|Date\|Moment) | Maximum selectable date | |
114 |
| -| **date** | Boolean | true => Has Datepicker (default: true) | |
115 |
| -| **time** | Boolean | true => Has Timepicker (default: true) | |
116 |
| -| **minutes** | Boolean | true => Has Timepicker minutes (default: true) | |
117 |
| -| **cancel-text** | String | Text for the cancel button (default: Cancel) | |
118 |
| -| **today-text** | String | Text for the today button (default: Today) | |
119 |
| -| **ok-text** | String | Text for the OK button (default: OK) | |
120 |
| -| **week-start** | Number | First day of the week (default: 0 => Sunday) | |
121 |
| -| **disable-dates** | Date[] | Dates to be disabled or not selectable by user.| |
122 |
| -| **disable-parent-scroll** | Boolean | true => Disable scrolling while the dialog is open (default : false) | |
| 100 | +| Name | Type | Description | |
| 101 | +| ------------------------- | ----------------------- | -------------------------------------------------------------------- | |
| 102 | +| **ng-model** | (String\|Date\|Moment | Initial Date or model to assign the date to | |
| 103 | +| **ng-change** | Function | A function to call when the input value changes. | |
| 104 | +| **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 | |
| 105 | +| **short-time** | Boolean | true => Display 12 hours AM\|PM (default: false) | |
| 106 | +| **min-date** | (String\|Date\|Moment) | Minimum selectable date | |
| 107 | +| **max-date** | (String\|Date\|Moment) | Maximum selectable date | |
| 108 | +| **date** | Boolean | true => Has Datepicker (default: true) | |
| 109 | +| **time** | Boolean | true => Has Timepicker (default: true) | |
| 110 | +| **minutes** | Boolean | true => Has Timepicker minutes (default: true) | |
| 111 | +| **cancel-text** | String | Text for the cancel button (default: Cancel) | |
| 112 | +| **today-text** | String | Text for the today button (default: Today) | |
| 113 | +| **ok-text** | String | Text for the OK button (default: OK) | |
| 114 | +| **week-start** | Number | First day of the week (default: 0 => Sunday) | |
| 115 | +| **disable-dates** | Date[] | Dates to be disabled or not selectable by user. | |
| 116 | +| **disable-parent-scroll** | Boolean | true => Disable scrolling while the dialog is open (default : false) | |
| 117 | +| **auto-ok** | Boolean | true => Single click (default: false) | |
123 | 118 |
|
124 | 119 | ### Date/Time Dialog Service
|
125 | 120 |
|
@@ -166,5 +161,6 @@ The `mdcDateTimeDialog.show` accepts the same options as the directive.
|
166 | 161 | pmText: {string} ='PM',
|
167 | 162 | disableDates: {date[]} =[],
|
168 | 163 | disableParentScroll: {boolean} = false,
|
| 164 | + autoOk: {boolean} =false |
169 | 165 | }
|
170 | 166 | ```
|
0 commit comments