Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
feat(dayView): allow all hour segment times to be shown
Browse files Browse the repository at this point in the history
Closes #429
  • Loading branch information
Matt Lewis committed Aug 27, 2016
1 parent da4718e commit 06bc836
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/examples/day-view-all-times/javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
angular
.module('mwl.calendar.docs')
.controller('DayViewAllTimesCtrl', function($scope, moment, calendarConfig) {

var vm = this;
vm.events = [];
vm.calendarView = 'day';
vm.viewDate = moment().startOf('month').toDate();
var originalFormat = calendarConfig.dateFormats.hour;
calendarConfig.dateFormats.hour = 'HH:mm';

$scope.$on('$destroy', function() {
calendarConfig.dateFormats.hour = originalFormat; // reset for other demos
});

});
12 changes: 12 additions & 0 deletions docs/examples/day-view-all-times/markup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div ng-controller="DayViewAllTimesCtrl as vm">
<style type="text/css">
.cal-day-hour-part-time strong.ng-hide {
display: block !important;
}
</style>
<mwl-calendar
events="vm.events"
view="vm.calendarView"
view-date="vm.viewDate">
</mwl-calendar>
</div>
3 changes: 3 additions & 0 deletions docs/examples/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@
}, {
"key": "all-day-events",
"label": "All day events"
}, {
"key": "day-view-all-times",
"label": "Show all times on day view"
}]
4 changes: 2 additions & 2 deletions src/templates/calendarHourList.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
on-drag-select-end="vm.onDragSelectEnd(vm.getClickedDate(segment.date, vm.dayViewSplit * ($index + 1)))"
ng-if="!vm.dayWidth">
<div class="cal-day-hour-part-time">
<strong ng-bind="segment.date | calendarDate:'hour':true" ng-if="segment.isStart"></strong>
<strong ng-bind="segment.date | calendarDate:'hour':true" ng-show="segment.isStart"></strong>
</div>
</div>

Expand All @@ -26,7 +26,7 @@
ng-repeat="segment in hour.segments track by $index"
ng-if="vm.dayWidth">
<div class="cal-day-hour-part-time">
<strong ng-bind="segment.date | calendarDate:'hour':true" ng-if="segment.isStart"></strong>
<strong ng-bind="segment.date | calendarDate:'hour':true" ng-show="segment.isStart"></strong>
&nbsp;
</div>
<div
Expand Down

0 comments on commit 06bc836

Please sign in to comment.