Skip to content

Commit dfdf68e

Browse files
kushthedudeabhinavk96
authored andcommitted
feat: Addition of Event End Date on Public Event Page (#3019)
* Event End Time on Public Pages Co-Authored-By: Niranjan Rajendran <[email protected]> * Remoal of extra parenthesis
1 parent 011ebf3 commit dfdf68e

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

app/controllers/public.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Controller from '@ember/controller';
2+
import moment from 'moment';
23
import { computed } from '@ember/object';
34

45
export default Controller.extend({
@@ -7,6 +8,9 @@ export default Controller.extend({
78
return this.get('session.currentRouteName') !== 'public.index';
89
}
910
}),
11+
displayEndDate: computed('model.startsAtDate', 'model.endsAtDate', function() {
12+
return !moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute');
13+
}),
1014
actions: {
1115
toggleMenu() {
1216
this.toggleProperty('isMenuOpen');

app/styles/pages/public-event.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@
7373
margin: 0;
7474
}
7575

76+
.event.time.ends {
77+
font-size: 1.25rem;
78+
margin: 0;
79+
}
80+
81+
7682
.event.location {
7783
font-size: 1.5rem;
7884
margin: 0;
@@ -91,6 +97,10 @@
9197
font-size: 1.25rem;
9298
}
9399

100+
.event.time.ends {
101+
font-size: 1.15rem;
102+
}
103+
94104
.event.location {
95105
font-size: 1.25rem;
96106
}

app/templates/public.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<div class="one wide column"></div>
1313
<div class="fifteen wide column">
1414
<h4 class="event time">{{header-date model.startsAt model.timezone}}</h4>
15+
{{#if displayEndDate}}
16+
<h5 class="event time ends">{{t 'To'}} {{header-date model.endsAt model.timezone}}</h5>
17+
{{/if}}
1518
<h1 class="event name">{{model.name}}</h1>
1619
<h4 class="event location"><i class="marker icon"></i>{{model.locationName}}</h4>
1720
</div>

0 commit comments

Comments
 (0)