diff --git a/README.md b/README.md index 44c799b..1575c9b 100644 --- a/README.md +++ b/README.md @@ -32,16 +32,16 @@ Attributes - date-format: optional, date format e.g. 'yyyy-MM-dd' - year: optional, year selected, e.g. 2015 - month: optional, month selected, e.g. 5 - - day: optiona, day selected, e.g. 31 + - day: optional, day selected, e.g. 31 - hour: optional, hour selected, 23 - minute: optional, minute selected, 59 - date-only: optional, if set, timepicker will be hidden - - future-only: optional, if set, forces validation errors on dates earlier than now + - future-only: optional, if set, Date which is older than today's Date will be not be selectable (Past time for same date is not handled) Examples -------- - + diff --git a/angularjs-datetime-picker.js b/angularjs-datetime-picker.js index a6780f6..88e6fb6 100644 --- a/angularjs-datetime-picker.js +++ b/angularjs-datetime-picker.js @@ -51,6 +51,9 @@ if (options.dateOnly === '' || options.dateOnly === true) { div.attr('date-only', 'true'); } + if (options.futureOnly === '' || options.futureOnly === true) { + div.attr('future-only', 'true'); + } if (options.closeOnSelect === 'false') { div.attr('close-on-select', 'false'); } @@ -115,9 +118,10 @@ '
', '
{{::dayOfWeek.firstLetter}}
', '
{{::day}}
', - '

Datetime Picker

- <input ng-model="date4" datetime-picker date-only />
-

+ <input ng-model="date0" datetime-picker date-only />
+

+ + <input ng-model="date1" datetime-picker date-only future-only />
+

<input ng-model="date2" datetime-picker date-format="yyyy-MM-dd" date-only />