Skip to content

Commit 4fca2b3

Browse files
committed
Use the pikaday attr as the date format. Drop need for extra format attr
1 parent 515bdcd commit 4fca2b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

angular-pikaday.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ angular.module('angular-pikaday', [])
4646
});
4747

4848
// Allow date format to be set and dynamically changed
49-
attrs.$observe('format', function(format) {
49+
attrs.$observe('pikaday', function(format) {
5050
if (format) {
5151
ngModel.picker._o.format = format;
5252
inputElement.val(ngModel.picker.toString());

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</tr>
2424
<tr>
2525
<th>Pikaday</th>
26-
<td><input type="text" pikaday format="{{pikaformat}}" ng-model-options="{ updateOn: 'default blur', debounce: {'default': 1000, 'blur': 0} }" ng-model="theValue" placeholder="Select Date"></td>
26+
<td><input type="text" pikaday="{{pikaformat}}" ng-model-options="{ updateOn: 'default blur', debounce: {'default': 1000, 'blur': 0} }" ng-model="theValue" placeholder="Select Date"></td>
2727
</tr>
2828
<tr ng-init="pikaformat = 'D MMM YYYY'">
2929
<th>Format</th>

0 commit comments

Comments
 (0)