Skip to content

Commit 1fb7f02

Browse files
committed
Added optional date and time formats used for display.
1 parent f8f72d7 commit 1fb7f02

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

src/date-input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div ng-click="toggleEditPopover()"
33
class="display"
44
ng-class="{'active': !!selected, 'warning': !!warning, '{{cssClass}}': !!cssClass}">
5-
<div class="date" ng-bind="date.format('DD MMMM YYYY')"></div>
5+
<div class="date" ng-bind="date.format(dateFormat || 'DD MMMM YYYY')"></div>
66
<div ng-if="!date" class="placeholder" ng-bind="placeholder"></div>
77
</div>
88
<div class="edit-popover" ng-show="!!selected">

src/date-input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ directive('dateInput', ['$document', '$timeout', function ($document, $timeout)
1010
scope: {
1111
date: '=',
1212
format: '=?',
13+
dateFormat: '=?',
1314
minDate:'=?',
1415
maxDate:'=?',
1516
onChange: '&',

src/datetime-input.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div ng-click="toggleEditPopover()"
33
class="display"
44
ng-class="{'active': !!selected, 'warning': !!warning, '{{cssClass}}': !!cssClass}">
5-
<div class="date" ng-bind="datetime.format('DD MMMM YYYY')"></div>
6-
<div class="time" ng-bind="datetime.format('HH : mm : ss')"></div>
5+
<div class="date" ng-bind="datetime.format(dateFormat || 'DD MMMM YYYY')"></div>
6+
<div class="time" ng-bind="datetime.format(timeFormat || 'HH : mm : ss')"></div>
77
<div ng-if="!datetime" class="placeholder" ng-bind="placeholder"></div>
88
</div>
99
<div class="edit-popover" ng-show="!!selected">

src/datetime-input.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ directive('datetimeInput', ['$document', '$timeout', function ($document, $timeo
1010
scope: {
1111
datetime: '=',
1212
format: '=?',
13+
dateFormat: '=?',
14+
timeFormat: '=?',
1315
minDate:'=?',
1416
maxDate:'=?',
1517
hourStep:'=?',

src/time-input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div ng-click="toggleEditPopover()"
33
class="display"
44
ng-class="{'active': !!selected, 'warning': !!warning, '{{cssClass}}': !!cssClass}">
5-
<div class="time" ng-bind="time.format('HH : mm : ss')"></div>
5+
<div class="time" ng-bind="time.format(timeFormat || 'HH : mm : ss')"></div>
66
<div ng-if="!time" class="placeholder" ng-bind="placeholder"></div>
77
</div>
88
<div class="edit-popover" ng-show="!!selected">

src/time-input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ directive('timeInput', ['$document', '$timeout', function ($document, $timeout)
1010
scope: {
1111
time: '=',
1212
format: '=?',
13+
timeFormat: '=?',
1314
minDate:'=?',
1415
maxDate:'=?',
1516
hourStep : '=?',

0 commit comments

Comments
 (0)