From 852d09a4fa432511fd13dc95e54bc2f5733bed30 Mon Sep 17 00:00:00 2001 From: Kush Trivedi Date: Mon, 27 May 2019 18:46:51 +0530 Subject: [PATCH 1/2] Event End Time on Public Pages Co-Authored-By: Niranjan Rajendran --- app/controllers/public.js | 4 ++++ app/styles/pages/public-event.scss | 10 ++++++++++ app/templates/public.hbs | 3 +++ 3 files changed, 17 insertions(+) diff --git a/app/controllers/public.js b/app/controllers/public.js index e7d7d91c85b..f415f0cfd67 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -1,4 +1,5 @@ import Controller from '@ember/controller'; +import moment from 'moment'; import { computed } from '@ember/object'; export default Controller.extend({ @@ -7,6 +8,9 @@ export default Controller.extend({ return this.get('session.currentRouteName') !== 'public.index'; } }), + displayEndDate: computed('model.startsAtDate', 'model.endsAtDate', function() { + return !(moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute')); + }), actions: { toggleMenu() { this.toggleProperty('isMenuOpen'); diff --git a/app/styles/pages/public-event.scss b/app/styles/pages/public-event.scss index 27b2643f0d3..f201b289ce3 100644 --- a/app/styles/pages/public-event.scss +++ b/app/styles/pages/public-event.scss @@ -73,6 +73,12 @@ margin: 0; } + .event.time.ends { + font-size: 1.25rem; + margin: 0; + } + + .event.location { font-size: 1.5rem; margin: 0; @@ -91,6 +97,10 @@ font-size: 1.25rem; } + .event.time.ends { + font-size: 1.15rem; + } + .event.location { font-size: 1.25rem; } diff --git a/app/templates/public.hbs b/app/templates/public.hbs index b1f21b919dc..c07de82c29c 100644 --- a/app/templates/public.hbs +++ b/app/templates/public.hbs @@ -12,6 +12,9 @@

{{header-date model.startsAt model.timezone}}

+ {{#if displayEndDate}} +
{{t 'To'}} {{header-date model.endsAt model.timezone}}
+ {{/if}}

{{model.name}}

{{model.locationName}}

From 5732bb896c46f9ff5b6907ef961e96e64f810298 Mon Sep 17 00:00:00 2001 From: kushthedude Date: Tue, 4 Jun 2019 07:25:20 +0530 Subject: [PATCH 2/2] Remoal of extra parenthesis --- app/controllers/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/public.js b/app/controllers/public.js index f415f0cfd67..e0f4b9f9b62 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -9,7 +9,7 @@ export default Controller.extend({ } }), displayEndDate: computed('model.startsAtDate', 'model.endsAtDate', function() { - return !(moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute')); + return !moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute'); }), actions: { toggleMenu() {