Skip to content

chore: Change general-date helper timezone argument #5799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/components/public/add-to-calender.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<i class="clock alternate outline icon pt-1"></i>
<div class="content">
{{#if this.isSingleDay}}
{{general-date @event.startsAt @event.timezone "dddd, D MMMM, YYYY"}}<br>{{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" [email protected]}}<br>{{general-date @event.startsAt "h:mm A" [email protected]}} {{t 'to'}} {{general-date @event.endsAt "h:mm A" [email protected]}}
{{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" [email protected]}} {{t 'to'}} {{general-date @event.endsAt "dddd, D MMMM, YYYY h:mm A" [email protected]}}
{{/if}}
({{this.timezone}})
<br>
Expand Down
4 changes: 2 additions & 2 deletions app/components/public/session-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="left floated twelve wide column">
{{#if @session.startsAt}}
<div class=""><i class="icon map marker alternate"></i>{{@session.microlocation.name}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt @timezone}} - {{general-date @session.endsAt @timezone}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt tz=@timezone}} - {{general-date @session.endsAt tz=@timezone}}</div>
{{/if}}
</div>
{{else}}
Expand All @@ -49,7 +49,7 @@
<div class="right floated four wide column">
{{#if @session.startsAt}}
<div class=""><i class="icon map marker alternate"></i>{{@session.microlocation.name}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt @timezone 'D MMM, YYYY h:mm A (z)'}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt 'D MMM, YYYY h:mm A (z)' tz=@timezone}}</div>
{{/if}}
</div>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui-table/cell/cell-date.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{general-date @record @props.options.timezone @props.options.dateFormat}}
{{general-date @record @props.options.dateFormat tz=@props.options.timezone}}
6 changes: 3 additions & 3 deletions app/helpers/general-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion app/templates/admin/sales/revenue.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{{order.name}}
</td>
<td>
{{general-date order.eventDate '' 'D MMM, YYYY'}}
{{general-date order.eventDate 'D MMM, YYYY'}}
</td>
<td class="right aligned">
{{order.ticketCount}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/event-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</SmartOverflow>
<div class="meta">
<span class="date">
{{general-date this.event.startsAt this.event.timezone}}
{{general-date this.event.startsAt tz=this.event.timezone}}
</span>
</div>
<SmartOverflow @class="description">
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/event-invoice/event-info.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<div class="ui padded segment">
<strong>{{t 'At'}} {{this.event.locationName}}</strong>
<br>
<strong>{{t 'From'}}:</strong> {{general-date this.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
<strong>{{t 'From'}}:</strong> {{general-date this.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
<br>
<strong>{{t 'To'}}:</strong> {{general-date this.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
<strong>{{t 'To'}}:</strong> {{general-date this.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{#if this.event.ownerName}}
<br>
<strong>{{t 'Organized By'}}:</strong> {{this.event.ownerName}}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/event-invoice/invoice-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<tbody>
<tr>
<td>{{this.event.name}}</td>
<td>{{general-date this.data.issuedAt '' 'D MMM, YYYY'}}</td>
<td>{{general-date this.data.completedAt '' 'D MMM, YYYY'}}</td>
<td>{{general-date this.data.issuedAt 'D MMM, YYYY'}}</td>
<td>{{general-date this.data.completedAt 'D MMM, YYYY'}}</td>
<td>{{currency-symbol this.eventCurrency}} {{format-money this.data.amount}}</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
</tr>
<tr>
<td><strong>{{t 'Start time'}}</strong></td>
<td>{{general-date this.data.event.startsAt this.data.event.timezone}}</td>
<td>{{general-date this.data.event.startsAt tz=this.data.event.timezone}}</td>
</tr>
<tr>
<td><strong>{{t 'End time'}}</strong></td>
<td>{{general-date this.data.event.endsAt this.data.event.timezone}}</td>
<td>{{general-date this.data.event.endsAt tz=this.data.event.timezone}}</td>
</tr>
<tr>
<td><strong>{{t 'Session types'}}</strong></td>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/footer-main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<div class="ui stackable grid">
<div class="thirteen wide computer twelve wide tablet column left aligned">
<div class="ui horizontal inverted small divided link list no top margin">
<span class="item">{{t 'Copyright'}} &copy; {{general-date (now) '' 'YYYY'}} {{this.settings.appName}} </span>
<span class="item">{{t 'Copyright'}} &copy; {{general-date (now) 'YYYY'}} {{this.settings.appName}} </span>
<span class="hidden-item">
{{!-- Possible Page Values --}}
{{t 'Terms'}}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/order-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</SmartOverflow>
<div class="meta">
<span class="date">
{{general-date this.order.event.startsAt this.order.event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
{{general-date this.order.event.startsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.order.event.timezone}}
</span>
</div>
<SmartOverflow @class="description">
Expand All @@ -46,7 +46,7 @@
</span>
<span>#{{this.order.identifier}}</span>
{{#if this.order.completedAt}}
<span>{{t 'on'}} {{general-date this.order.completedAt '' 'D MMM, YYYY h:mm A'}}</span>
<span>{{t 'on'}} {{general-date this.order.completedAt 'D MMM, YYYY h:mm A'}}</span>
{{/if}}
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/orders/event-info.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<strong>{{t 'Location or online event details to be announced'}}</strong>
{{/if}}
<br>
<strong>{{t 'From'}}:</strong> {{general-date this.data.event.startsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
<strong>{{t 'From'}}:</strong> {{general-date this.data.event.startsAt 'dddd, D MMMM, YYYY h:mm A'}}
<br>
<strong>{{t 'To'}}:</strong> {{general-date this.data.event.endsAt '' 'dddd, D MMMM, YYYY h:mm A'}}
<strong>{{t 'To'}}:</strong> {{general-date this.data.event.endsAt 'dddd, D MMMM, YYYY h:mm A'}}
{{#if this.data.event.ownerName}}
<br>
<strong>{{t 'Organized By'}}:</strong> {{this.data.event.ownerName}}
Expand Down
6 changes: 3 additions & 3 deletions app/templates/components/public/call-for-speakers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
{{#if this.data.speakersCall.isOpen}}
<a href="#" class="ui basic green label">{{t 'Open'}}</a>
<div class="sub header">
{{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}}
</div>
{{else}}
<a href="#" class="ui basic red label">{{t 'Closed'}}</a>
<div class="sub header">
{{#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}}
</div>
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/public/speaker-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
{{#if session.startsAt}}
<p>
<strong>
{{general-date session.startsAt @timezone}}
{{general-date session.startsAt tz=@timezone}}
</strong>
</p>
{{/if}}
<a href="{{href-to 'public.session.view' session.id}}">
<div class="ui fluid rounded-default p-4" style={{css color=(text-color session.track.color) background-color=session.track.color}}>
<div style={{css opacity=0.9}}>
{{#if (and session.startsAt session.endsAt)}}
<strong>{{general-date session.startsAt @timezone 'HH:mm'}} - {{general-date session.endsAt @timezone 'hh:mm'}}</strong>
<strong>{{general-date session.startsAt 'HH:mm' tz=@timezone}} - {{general-date session.endsAt 'hh:mm' tz=@timezone}}</strong>
{{/if}}
<h3 class="m-0" style={{css user-select='text'}}>
{{session.title}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/public/ticket-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<small class="ui gray-text tiny">{{ticket.description}}</small>
{{/if}}
<div>
<small class="ui gray-text small">Sale ends on {{general-date ticket.salesEndsAt @event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</small>
<small class="ui gray-text small">Sale ends on {{general-date ticket.salesEndsAt 'dddd, D MMMM, YYYY h:mm A (z)' [email protected]}}</small>
</div>
</td>
<td></td>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/public/track-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</div>
{{/each}}
<div class=""><i class="icon map marker alternate"></i>{{this.session.microlocation.name}}</div>
{{general-date this.session.startsAt this.session.event.timezone}} - {{general-date this.session.endsAt this.session.event.timezone}}<br/>
{{general-date this.session.startsAt tz=this.session.event.timezone}} - {{general-date this.session.endsAt tz=this.session.event.timezone}}<br/>
{{this.session.track.name}}
</div>
</UiAccordion>
2 changes: 1 addition & 1 deletion app/templates/components/session-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="meta">
<span class="time">
{{#if this.session.startsAt}}
{{general-date this.session.startsAt '' 'D MMM, YYYY h:mm A'}}
{{general-date this.session.startsAt 'D MMM, YYYY h:mm A'}}
{{else}}
{{t 'Session Not Yet Scheduled'}}
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/ui-table/cell/cell-event-date.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{#if this.record}}
{{#if this.extraRecords.endsAt}}
<div>
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
{{general-date this.record "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
</div>
(to)
<div>
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
{{general-date this.record "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
</div>
{{else}}
<span>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/ui-table/cell/cell-simple-date.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#if this.extraRecords.timezone}}
<span>
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
{{general-date this.record "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
</span>
{{else if this.record}}
<span>
{{general-date this.record '' (if this.props.options.dateFormat this.props.options.dateFormat "D MMM, YYYY h:mm A")}}
{{general-date this.record (if this.props.options.dateFormat this.props.options.dateFormat "D MMM, YYYY h:mm A")}}
</span>
{{/if}}
4 changes: 2 additions & 2 deletions app/templates/components/ui-table/cell/cell-validity.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span>
{{general-date this.record '' 'D MMM, YYYY h:mm A'}}
{{general-date this.record 'D MMM, YYYY h:mm A'}}
<br>To<br>
{{general-date this.extraRecords.validTill '' 'D MMM, YYYY h:mm A'}}
{{general-date this.extraRecords.validTill 'D MMM, YYYY h:mm A'}}
</span>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#if (eq @record.status 'completed')}}
{{general-date @record.completedAt '' "D MMM, YYYY h:mm A"}}
{{general-date @record.completedAt "D MMM, YYYY h:mm A"}}
{{else}}
{{general-date @record.createdAt '' "D MMM, YYYY h:mm A"}}
{{general-date @record.createdAt "D MMM, YYYY h:mm A"}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</span>
{{/if}}
{{#if (eq this.record.status 'completed')}}
{{general-date this.record.completedAt '' 'D MMM, YYYY h:mm A'}}
{{general-date this.record.completedAt 'D MMM, YYYY h:mm A'}}
{{moment-from-now this.record.completedAt}}
{{else}}
{{general-date this.record.createdAt '' 'D MMM, YYYY h:mm A'}}
{{general-date this.record.createdAt 'D MMM, YYYY h:mm A'}}
{{moment-from-now this.record.createdAt}}
{{/if}}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span>
{{general-date this.record '' 'D MMM, YYYY h:mm A'}}
{{general-date this.record 'D MMM, YYYY h:mm A'}}
</span>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#if this.record}}
<div>
{{general-date this.record '' 'D MMM, YYYY h:mm A'}}
{{general-date this.record 'D MMM, YYYY h:mm A'}}
</div>
{{else}}
<div>
{{general-date this.extraRecords.createdAt '' 'D MMM, YYYY h:mm A'}}
{{general-date this.extraRecords.createdAt 'D MMM, YYYY h:mm A'}}
</div>
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
{{/if}}
<span class="muted text">
{{#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}}
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/explore.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
{{/if}}
{{#if this.filters.start_date}}
<div class="ui mini label">
{{general-date this.filters.start_date '' 'D MMM, YYYY'}}
{{general-date this.filters.start_date 'D MMM, YYYY'}}
<a href="#" role="button" {{action 'clearFilter' 'start_date'}}><i class="icon close"></i></a>
</div>
{{/if}}
{{#if this.filters.end_date}}
<div class="ui mini label">
{{general-date this.filters.end_date '' 'D MMM, YYYY'}}
{{general-date this.filters.end_date 'D MMM, YYYY'}}
<a href="#" role="button" {{action 'clearFilter' 'end_date'}}><i class="icon close"></i></a>
</div>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/orders/expired.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row">
<div class="column">
<div class="ui small gray-text">
{{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'}}
<br>
{{this.model.event.locationName}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/orders/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="row">
<div class="column">
<div class="ui small gray-text">
{{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'}}
<br>
{{this.model.order.event.locationName}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/orders/pending.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="row">
<div class="column">
<div class="ui small gray-text">
{{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'}}
<br>
{{this.model.order.event.locationName}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/orders/view.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row print">
<div class="column">
<div class="ui small gray-text">
{{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'}}
<br>
{{this.model.order.event.locationName}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/public.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<img src="{{this.model.logoUrl}}" class="logo mr-8" />
{{/if}}
<div>
<h4 class="event time">{{general-date this.model.startsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</h4>
<h4 class="event time">{{general-date this.model.startsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.model.timezone}}</h4>
{{#if this.displayEndDate}}
<h5 class="event time ends">{{t 'To'}} {{general-date this.model.endsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</h5>
<h5 class="event time ends">{{t 'To'}} {{general-date this.model.endsAt 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.model.timezone}}</h5>
{{/if}}
<h1 class="event name">{{this.model.name}}</h1>
<h4 class="event location"><i class="icon map marker alternate"></i>{{this.headerLocation}}</h4>
Expand Down
8 changes: 4 additions & 4 deletions app/templates/public/sessions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="d-flex wrap">
<LinkTo @route="public.sessions" @models={{array this.model.event.id}} @query={{hash date=null}} class="ui button mb-2">{{t 'All'}}</LinkTo>
{{#each this.allDates as |date|}}
<LinkTo @route="public.sessions" @models={{array this.model.event.id}} @query={{hash date=(moment-format date "YYYY-MM-DD")}} class="ui button mb-2">{{general-date date '' 'D MMM, YYYY'}}</LinkTo>
<LinkTo @route="public.sessions" @models={{array this.model.event.id}} @query={{hash date=(moment-format date "YYYY-MM-DD")}} class="ui button mb-2">{{general-date date 'D MMM, YYYY'}}</LinkTo>
{{/each}}

<Widgets::TimeZonePicker
Expand All @@ -27,8 +27,8 @@
{{#each this.model.session as |session|}}
<div class="ui grid">
<div class="three wide column">
{{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}}
</div>
<div class="thirteen wide column">
<Public::TrackItem @session={{session}} />
Expand Down Expand Up @@ -59,7 +59,7 @@
<tr>
<td class="top aligned {{unless this.device.isMobile 'centered text'}}" style="border-top: none;">
<h4 class="ui header {{unless this.device.isMobile 'pt-4'}}" style="color: rgba(0, 0, 0, 0.7);">
{{general-date session.startsAt this.timezone 'h:mm A (z)'}}
{{general-date session.startsAt 'h:mm A (z)' tz=this.timezone}}
</h4>
</td>
<td style="border-top: none; border-left: 1px solid lightgrey">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/helpers/general-date-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)');
});
});