{{general-date @event.startsAt @event.timezone "h:mm A"}} {{t 'to'}} {{general-date @event.endsAt @event.timezone "h:mm A"}} + {{general-date @event.startsAt "dddd, D MMMM, YYYY" tz=@event.timezone}}
{{general-date @event.startsAt "h:mm A" tz=@event.timezone}} {{t 'to'}} {{general-date @event.endsAt "h:mm A" tz=@event.timezone}} {{else}} - {{general-date @event.startsAt @event.timezone "dddd, D MMMM, YYYY h:mm A"}} {{t 'to'}} {{general-date @event.endsAt @event.timezone "dddd, D MMMM, YYYY h:mm A"}} + {{general-date @event.startsAt "dddd, D MMMM, YYYY h:mm A" tz=@event.timezone}} {{t 'to'}} {{general-date @event.endsAt "dddd, D MMMM, YYYY h:mm A" tz=@event.timezone}} {{/if}} ({{this.timezone}})
diff --git a/app/components/public/session-item.hbs b/app/components/public/session-item.hbs index 742b2062fec..c137cb5268d 100644 --- a/app/components/public/session-item.hbs +++ b/app/components/public/session-item.hbs @@ -27,7 +27,7 @@
{{#if @session.startsAt}}
{{else}}
@@ -49,7 +49,7 @@
{{@session.microlocation.name}}
- {{general-date @session.startsAt @timezone}} - {{general-date @session.endsAt @timezone}}
+ {{general-date @session.startsAt tz=@timezone}} - {{general-date @session.endsAt tz=@timezone}}
{{/if}}
{{#if @session.startsAt}}
{{/if}}
diff --git a/app/components/ui-table/cell/cell-date.hbs b/app/components/ui-table/cell/cell-date.hbs
index a70d6aef47d..612c7520c3c 100644
--- a/app/components/ui-table/cell/cell-date.hbs
+++ b/app/components/ui-table/cell/cell-date.hbs
@@ -1 +1 @@
-{{general-date @record @props.options.timezone @props.options.dateFormat}}
+{{general-date @record @props.options.dateFormat tz=@props.options.timezone}}
diff --git a/app/helpers/general-date.js b/app/helpers/general-date.js
index 368d11a5bee..04637f6619d 100644
--- a/app/helpers/general-date.js
+++ b/app/helpers/general-date.js
@@ -3,12 +3,12 @@ import moment from 'moment';
const locales12Hours = new Set(['en', 'bn', 'hi', 'id', 'ja', 'run', 'th', 'vi', 'ko']);
-export function generalDate(params) {
- const timezone = params[1] || moment.tz.guess();
+export function generalDate(params, { tz }) {
+ const timezone = tz || moment.tz.guess();
const local = moment(params[0]).tz(timezone).locale();
- let format = params[2] || 'h:mm A, MMMM Do YYYY (z)';
+ let format = params[1] || 'h:mm A, MMMM Do YYYY (z)';
if (!locales12Hours.has(local)) {
format = format.replaceAll('h', 'H');
diff --git a/app/templates/admin/sales/revenue.hbs b/app/templates/admin/sales/revenue.hbs
index 08f2e412d48..ccc5e391828 100644
--- a/app/templates/admin/sales/revenue.hbs
+++ b/app/templates/admin/sales/revenue.hbs
@@ -38,7 +38,7 @@
{{order.name}}
{{@session.microlocation.name}}
- {{general-date @session.startsAt @timezone 'D MMM, YYYY h:mm A (z)'}}
+ {{general-date @session.startsAt 'D MMM, YYYY h:mm A (z)' tz=@timezone}}
{{/if}}
{{t 'At'}} {{this.event.locationName}}
- {{t 'From'}}: {{general-date this.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'From'}}: {{general-date this.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
- {{t 'To'}}: {{general-date this.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'To'}}: {{general-date this.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}} {{#if this.event.ownerName}}
{{t 'Organized By'}}: {{this.event.ownerName}} diff --git a/app/templates/components/event-invoice/invoice-summary.hbs b/app/templates/components/event-invoice/invoice-summary.hbs index 416225341d0..3e7c7cb7dcb 100644 --- a/app/templates/components/event-invoice/invoice-summary.hbs +++ b/app/templates/components/event-invoice/invoice-summary.hbs @@ -26,8 +26,8 @@
{{this.event.name}}
- {{general-date this.data.issuedAt '' 'D MMM, YYYY'}}
- {{general-date this.data.completedAt '' 'D MMM, YYYY'}}
+ {{general-date this.data.issuedAt 'D MMM, YYYY'}}
+ {{general-date this.data.completedAt 'D MMM, YYYY'}}
{{currency-symbol this.eventCurrency}} {{format-money this.data.amount}}
diff --git a/app/templates/components/events/view/overview/general-info.hbs b/app/templates/components/events/view/overview/general-info.hbs
index 6f795a5c76e..2209f4edc29 100644
--- a/app/templates/components/events/view/overview/general-info.hbs
+++ b/app/templates/components/events/view/overview/general-info.hbs
@@ -25,11 +25,11 @@
{{t 'Start time'}}
- {{general-date this.data.event.startsAt this.data.event.timezone}}
+ {{general-date this.data.event.startsAt tz=this.data.event.timezone}}
{{t 'End time'}}
- {{general-date this.data.event.endsAt this.data.event.timezone}}
+ {{general-date this.data.event.endsAt tz=this.data.event.timezone}}
{{t 'Session types'}}
diff --git a/app/templates/components/footer-main.hbs b/app/templates/components/footer-main.hbs
index fb9f45b5f36..7d7ab508cd2 100644
--- a/app/templates/components/footer-main.hbs
+++ b/app/templates/components/footer-main.hbs
@@ -105,7 +105,7 @@
- {{t 'From'}}: {{general-date this.data.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'From'}}: {{general-date this.data.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
- {{t 'To'}}: {{general-date this.data.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'To'}}: {{general-date this.data.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}} {{#if this.data.event.ownerName}}
{{t 'Organized By'}}: {{this.data.event.ownerName}} diff --git a/app/templates/components/public/call-for-speakers.hbs b/app/templates/components/public/call-for-speakers.hbs index 82c09a69ca3..75e5c5d7d7c 100644 --- a/app/templates/components/public/call-for-speakers.hbs +++ b/app/templates/components/public/call-for-speakers.hbs @@ -4,15 +4,15 @@ {{#if this.data.speakersCall.isOpen}} {{t 'Open'}}
+ {{general-date this.session.startsAt tz=this.session.event.timezone}} - {{general-date this.session.endsAt tz=this.session.event.timezone}}
{{this.session.track.name}}
diff --git a/app/templates/components/session-card.hbs b/app/templates/components/session-card.hbs
index d2b273ad2ef..8494bdae418 100644
--- a/app/templates/components/session-card.hbs
+++ b/app/templates/components/session-card.hbs
@@ -20,7 +20,7 @@
diff --git a/app/templates/components/ui-table/cell/events/view/tickets/discount-codes/cell-validity.hbs b/app/templates/components/ui-table/cell/events/view/tickets/discount-codes/cell-validity.hbs
index acf3f429f38..6fde70bd393 100644
--- a/app/templates/components/ui-table/cell/events/view/tickets/discount-codes/cell-validity.hbs
+++ b/app/templates/components/ui-table/cell/events/view/tickets/discount-codes/cell-validity.hbs
@@ -1,3 +1,3 @@
- {{general-date this.record '' 'D MMM, YYYY h:mm A'}}
+ {{general-date this.record 'D MMM, YYYY h:mm A'}}
diff --git a/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-date.hbs b/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-date.hbs
index 9c85c9eb608..e3b6b7bf56e 100644
--- a/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-date.hbs
+++ b/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-date.hbs
@@ -1,9 +1,9 @@
{{#if this.record}}
diff --git a/app/templates/explore.hbs b/app/templates/explore.hbs
index f5cbad5420e..881953be818 100644
--- a/app/templates/explore.hbs
+++ b/app/templates/explore.hbs
@@ -25,13 +25,13 @@
{{/if}}
{{#if this.filters.start_date}}
{{/if}}
- {{t 'From'}}: {{general-date this.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'From'}}: {{general-date this.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
- {{t 'To'}}: {{general-date this.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'To'}}: {{general-date this.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}} {{#if this.event.ownerName}}
{{t 'Organized By'}}: {{this.event.ownerName}} diff --git a/app/templates/components/event-invoice/invoice-summary.hbs b/app/templates/components/event-invoice/invoice-summary.hbs index 416225341d0..3e7c7cb7dcb 100644 --- a/app/templates/components/event-invoice/invoice-summary.hbs +++ b/app/templates/components/event-invoice/invoice-summary.hbs @@ -26,8 +26,8 @@
- {{t 'Copyright'}} © {{general-date (now) '' 'YYYY'}} {{this.settings.appName}}
+ {{t 'Copyright'}} © {{general-date (now) 'YYYY'}} {{this.settings.appName}}
{{!-- Possible Page Values --}}
{{t 'Terms'}}
diff --git a/app/templates/components/order-card.hbs b/app/templates/components/order-card.hbs
index 1d56fb6c5b3..6a8e3afa033 100644
--- a/app/templates/components/order-card.hbs
+++ b/app/templates/components/order-card.hbs
@@ -27,7 +27,7 @@
@@ -46,7 +46,7 @@
#{{this.order.identifier}}
{{#if this.order.completedAt}}
- {{t 'on'}} {{general-date this.order.completedAt '' 'D MMM, YYYY h:mm A'}}
+ {{t 'on'}} {{general-date this.order.completedAt 'D MMM, YYYY h:mm A'}}
{{/if}}
diff --git a/app/templates/components/orders/event-info.hbs b/app/templates/components/orders/event-info.hbs
index 872f1404804..51d99aa933f 100644
--- a/app/templates/components/orders/event-info.hbs
+++ b/app/templates/components/orders/event-info.hbs
@@ -24,9 +24,9 @@
{{t 'Location or online event details to be announced'}}
{{/if}}
- {{t 'From'}}: {{general-date this.data.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'From'}}: {{general-date this.data.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
- {{t 'To'}}: {{general-date this.data.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}} + {{t 'To'}}: {{general-date this.data.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}} {{#if this.data.event.ownerName}}
{{t 'Organized By'}}: {{this.data.event.ownerName}} diff --git a/app/templates/components/public/call-for-speakers.hbs b/app/templates/components/public/call-for-speakers.hbs index 82c09a69ca3..75e5c5d7d7c 100644 --- a/app/templates/components/public/call-for-speakers.hbs +++ b/app/templates/components/public/call-for-speakers.hbs @@ -4,15 +4,15 @@ {{#if this.data.speakersCall.isOpen}} {{t 'Open'}}
- {{t 'Call for Speakers is open until'}} {{general-date this.data.speakersCall.endsAt this.data.speakersCall.event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+ {{t 'Call for Speakers is open until'}} {{general-date this.data.speakersCall.endsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.data.speakersCall.event.timezone}}
{{else}}
{{t 'Closed'}}
{{#if this.data.speakersCall.isInFuture}}
- {{t 'Call for Speakers will open at'}} {{general-date this.data.speakersCall.endsAt this.data.speakersCall.event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+ {{t 'Call for Speakers will open at'}} {{general-date this.data.speakersCall.endsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.data.speakersCall.event.timezone}}
{{else}}
- {{t 'Call for Speakers was closed at'}} {{general-date this.data.speakersCall.endsAt this.data.speakersCall.event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+ {{t 'Call for Speakers was closed at'}} {{general-date this.data.speakersCall.endsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.data.speakersCall.event.timezone}}
{{/if}}
{{/if}}
diff --git a/app/templates/components/public/speaker-item.hbs b/app/templates/components/public/speaker-item.hbs
index 07296769c6f..5d2724b21f5 100644
--- a/app/templates/components/public/speaker-item.hbs
+++ b/app/templates/components/public/speaker-item.hbs
@@ -48,7 +48,7 @@
{{#if session.startsAt}}
- {{general-date session.startsAt @timezone}} + {{general-date session.startsAt tz=@timezone}}
{{/if}} @@ -56,7 +56,7 @@
{{#if (and session.startsAt session.endsAt)}}
- {{general-date session.startsAt @timezone 'HH:mm'}} - {{general-date session.endsAt @timezone 'hh:mm'}}
+ {{general-date session.startsAt 'HH:mm' tz=@timezone}} - {{general-date session.endsAt 'hh:mm' tz=@timezone}}
{{/if}}
{{session.title}}
diff --git a/app/templates/components/public/ticket-list.hbs b/app/templates/components/public/ticket-list.hbs
index 589eed54c06..b982811057b 100644
--- a/app/templates/components/public/ticket-list.hbs
+++ b/app/templates/components/public/ticket-list.hbs
@@ -28,7 +28,7 @@
{{ticket.description}}
{{/if}}
{{/each}}
{{session.title}}
diff --git a/app/templates/components/public/ticket-list.hbs b/app/templates/components/public/ticket-list.hbs
index 589eed54c06..b982811057b 100644
--- a/app/templates/components/public/ticket-list.hbs
+++ b/app/templates/components/public/ticket-list.hbs
@@ -28,7 +28,7 @@
{{ticket.description}}
{{/if}}
- Sale ends on {{general-date ticket.salesEndsAt @event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+ Sale ends on {{general-date ticket.salesEndsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=@event.timezone}}
diff --git a/app/templates/components/public/track-item.hbs b/app/templates/components/public/track-item.hbs
index bb10c81f0e7..c2b12c75c59 100644
--- a/app/templates/components/public/track-item.hbs
+++ b/app/templates/components/public/track-item.hbs
@@ -79,7 +79,7 @@
{{this.session.microlocation.name}}
- {{general-date this.session.startsAt this.session.event.timezone}} - {{general-date this.session.endsAt this.session.event.timezone}}+ {{general-date this.session.startsAt tz=this.session.event.timezone}} - {{general-date this.session.endsAt tz=this.session.event.timezone}}
{{this.session.track.name}}
- {{general-date this.record '' 'D MMM, YYYY h:mm A'}}
+ {{general-date this.record 'D MMM, YYYY h:mm A'}}
{{else}}
- {{general-date this.extraRecords.createdAt '' 'D MMM, YYYY h:mm A'}}
+ {{general-date this.extraRecords.createdAt 'D MMM, YYYY h:mm A'}}
{{/if}}
diff --git a/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-order.hbs b/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-order.hbs
index c2f4ddabee8..9a06c532675 100644
--- a/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-order.hbs
+++ b/app/templates/components/ui-table/cell/events/view/tickets/orders/cell-order.hbs
@@ -13,9 +13,9 @@
{{/if}}
{{#if this.extraRecords.completedAt}}
- {{general-date this.extraRecords.completedAt '' 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.completedAt}}
+ {{general-date this.extraRecords.completedAt 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.completedAt}}
{{else}}
- {{general-date this.extraRecords.createdAt '' 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.createdAt}}
+ {{general-date this.extraRecords.createdAt 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.createdAt}}
{{/if}}
- {{general-date this.filters.start_date '' 'D MMM, YYYY'}}
+ {{general-date this.filters.start_date 'D MMM, YYYY'}}
{{/if}}
{{#if this.filters.end_date}}
- {{general-date this.filters.end_date '' 'D MMM, YYYY'}}
+ {{general-date this.filters.end_date 'D MMM, YYYY'}}
{{/if}}
diff --git a/app/templates/orders/expired.hbs b/app/templates/orders/expired.hbs
index cbd6bd4fd97..173f6864c89 100644
--- a/app/templates/orders/expired.hbs
+++ b/app/templates/orders/expired.hbs
@@ -7,7 +7,7 @@
- {{general-date this.model.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
+ {{general-date this.model.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{this.model.event.locationName}}
diff --git a/app/templates/orders/new.hbs b/app/templates/orders/new.hbs
index 58c640a859d..420cd9f21a8 100644
--- a/app/templates/orders/new.hbs
+++ b/app/templates/orders/new.hbs
@@ -8,7 +8,7 @@
{{this.model.event.locationName}}
- {{general-date this.model.order.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
+ {{general-date this.model.order.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{this.model.order.event.locationName}}
diff --git a/app/templates/orders/pending.hbs b/app/templates/orders/pending.hbs
index 7708eb128c4..25998f5cb7d 100644
--- a/app/templates/orders/pending.hbs
+++ b/app/templates/orders/pending.hbs
@@ -8,7 +8,7 @@
{{this.model.order.event.locationName}}
- {{general-date this.model.order.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
+ {{general-date this.model.order.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{this.model.order.event.locationName}}
diff --git a/app/templates/orders/view.hbs b/app/templates/orders/view.hbs
index c0e4fd448bc..3932bceedca 100644
--- a/app/templates/orders/view.hbs
+++ b/app/templates/orders/view.hbs
@@ -7,7 +7,7 @@
{{this.model.order.event.locationName}}
- {{general-date this.model.order.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
+ {{general-date this.model.order.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}} - {{general-date this.model.order.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{this.model.order.event.locationName}}
diff --git a/app/templates/public.hbs b/app/templates/public.hbs
index 6cc2734df3d..de27ac390af 100644
--- a/app/templates/public.hbs
+++ b/app/templates/public.hbs
@@ -9,9 +9,9 @@
{{this.model.order.event.locationName}}
-
{{t 'All'}}
{{#each this.allDates as |date|}}
- {{general-date date '' 'D MMM, YYYY'}}
+ {{general-date date 'D MMM, YYYY'}}
{{/each}}
@@ -59,7 +59,7 @@
diff --git a/tests/integration/helpers/general-date-test.js b/tests/integration/helpers/general-date-test.js
index 3753064b465..e8f1a576b4e 100644
--- a/tests/integration/helpers/general-date-test.js
+++ b/tests/integration/helpers/general-date-test.js
@@ -10,7 +10,7 @@ module('Integration | Helper | general date', function(hooks) {
test('it renders', async function(assert) {
this.set('inputMomentValue', moment('2019-05-01T03:30:00+09:00'));
this.set('inputTimezoneValue', 'Japan');
- await render(hbs`{{general-date inputMomentValue inputTimezoneValue}}`);
+ await render(hbs`{{general-date inputMomentValue tz=inputTimezoneValue}}`);
assert.equal(this.element.innerHTML.trim(), '3:30 AM, May 1st 2019 (JST)');
});
});
{{general-date this.model.startsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+{{general-date this.model.startsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.model.timezone}}
{{#if this.displayEndDate}} -{{t 'To'}} {{general-date this.model.endsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
+{{t 'To'}} {{general-date this.model.endsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.model.timezone}}
{{/if}}{{this.model.name}}
{{this.headerLocation}}
diff --git a/app/templates/public/sessions.hbs b/app/templates/public/sessions.hbs index 9b9f6d84daa..a3f982a148c 100644 --- a/app/templates/public/sessions.hbs +++ b/app/templates/public/sessions.hbs @@ -3,7 +3,7 @@
- {{general-date session.startsAt session.event.timezone 'hh:mm a'}} -
- {{general-date session.endsAt session.event.timezone 'hh:mm a'}}
+ {{general-date session.startsAt 'hh:mm a' tz=session.event.timezone}} -
+ {{general-date session.endsAt 'hh:mm a' tz=session.event.timezone}}