Skip to content

Commit

Permalink
Add light grey background colour if day is in different month
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Apr 18, 2018
1 parent 7f7fd87 commit 11bb792
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -4,7 +4,7 @@ import { eventsForDay } from '../lib/date-utilities';
const MAX_EVENTS = 4;

export default Ember.Component.extend({
classNameBindings: [':day', 'classes'],
classNameBindings: [':day', 'classes', 'differentMonth'],
hidden: 0,
hasHidden: Ember.computed.gt('hidden', 0),

Expand All @@ -13,6 +13,11 @@ export default Ember.Component.extend({
return date === expandedDate;
},

@computed('month', 'currentMonth')
differentMonth(month, currentMonth) {
return month !== currentMonth
},

@on('init')
@observes('expanded')
setEvents() {
Expand Down
8 changes: 7 additions & 1 deletion assets/stylesheets/common/events.scss
Expand Up @@ -289,12 +289,12 @@

.day {
height: 38px;
padding-top: 2px;
cursor: pointer;
position: relative;

.header {
text-align: center;
margin-top: 2px;
}

.date label {
Expand Down Expand Up @@ -353,6 +353,12 @@
height: 100%;
}

&.different-month .container {
background-color: rgba($primary-low, .5);
color: rgba($primary, .5);
height: 100%;
}

&.selected .date label {
background-color: $tertiary;
color: $secondary;
Expand Down

0 comments on commit 11bb792

Please sign in to comment.