Skip to content

fix: time standardization in two formats only #5747

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 6 commits into from
Nov 26, 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, MMMM DD, 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 @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"}}
{{else}}
{{general-date @event.startsAt @event.timezone "dddd, MMMM DD, YYYY h:mm A"}} {{t 'to'}} {{general-date @event.endsAt @event.timezone "dddd, MMMM DD, YYYY h:mm A"}}
{{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"}}
{{/if}}
({{this.timezone}})
<br>
Expand Down
2 changes: 1 addition & 1 deletion app/components/public/session-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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 'hh:mm a / DD-MM-YYYY (z)'}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt @timezone 'D MMM, YYYY h:mm A (z)'}}</div>
{{/if}}
</div>
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/account/billing/invoices/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/cell-date',
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
dateFormat : 'D MMM, YYYY'
}
},
{
Expand All @@ -37,7 +37,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/cell-date',
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
dateFormat : 'D MMM, YYYY'
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/sales/invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/cell-date',
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
dateFormat : 'D MMM, YYYY'
}
},
{
Expand All @@ -36,7 +36,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/cell-date',
options : {
timezone : 'UTC',
dateFormat : 'MMMM DD, YYYY'
dateFormat : 'D MMM, YYYY'
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/sessions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'MMMM DD, YYYY - hh:mm A'
dateFormat: 'D MMM, YYYY h:mm A'
}
},
{
Expand All @@ -44,7 +44,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'MMMM DD, YYYY - hh:mm A'
dateFormat: 'D MMM, YYYY h:mm A'
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/users/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
headerComponent : 'tables/headers/sort',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'MMMM DD, YYYY - hh:mm A'
dateFormat: 'D MMM, YYYY h:mm A'
}
}
];
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
headerComponent : 'tables/headers/sort',
cellComponent : 'ui-table/cell/cell-event-general',
options : {
dateFormat: 'MMMM DD, YYYY - HH:mm A'
dateFormat: 'D MMM, YYYY h:mm A'
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/events/view/sessions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
valuePath : 'submittedAt',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'MMMM DD, YYYY - HH:mm'
dateFormat: 'D MMM, YYYY h:mm A (z)'
}
},
{
Expand All @@ -82,7 +82,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
valuePath : 'lastModifiedAt',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'MMMM DD, YYYY - HH:mm'
dateFormat: 'D MMM, YYYY h:mm A (z)'
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/events/view/tickets/orders/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/events/view/tickets/orders/cell-date',
headerComponent : 'tables/headers/sort',
width : 100,
dateFormat : 'MMMM DD, YYYY - HH:mm A',
Copy link
Member

@divyamtayal divyamtayal Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls also correct this declaration, here I think we need to define dateFormat inside options as an object

dateFormat : 'D MMM, YYYY h:mm A (z)',
isSortable : true
},
{
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>
{{moment-format order.eventDate 'MM/DD/YYYY'}}
{{moment-format order.eventDate 'D MMM, YYYY'}}
</td>
<td class="right aligned">
{{order.ticketCount}}
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>{{moment-format this.data.issuedAt 'MM/DD/YYYY'}}</td>
<td>{{moment-format this.data.completedAt 'MM/DD/YYYY'}}</td>
<td>{{moment-format this.data.issuedAt 'D MMM, YYYY'}}</td>
<td>{{moment-format this.data.completedAt 'D MMM, YYYY'}}</td>
<td>{{currency-symbol this.eventCurrency}} {{format-money this.data.amount}}</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion 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">
{{moment-format this.order.event.startsAt 'ddd, DD MMMM YYYY, h:mm A'}}
{{general-date this.order.event.startsAt this.order.event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}
</span>
</div>
<SmartOverflow @class="description">
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'}} {{moment-format this.data.speakersCall.endsAt 'ddd, MMM DD h:mm A'}}
{{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)'}}
</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'}} {{moment-format this.data.speakersCall.startsAt 'ddd, MMM DD h:mm A' }}
{{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)'}}
{{else}}
{{t 'Call for Speakers was closed at'}} {{moment-format this.data.speakersCall.endsAt 'ddd, MMM DD h:mm A'}}
{{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)'}}
{{/if}}
</div>
{{/if}}
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 {{moment-format ticket.salesEndsAt 'ddd, DD MMMM YY, h:mm A'}}</small>
<small class="ui gray-text small">Sale ends on {{general-date ticket.salesEndsAt @event.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</small>
</div>
</td>
<td></td>
Expand Down
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}}
{{moment-format this.session.startsAt 'ddd, MMM DD h:mm A'}}
{{moment-format 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}}
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
</div>
(to)
<div>
{{general-date this.extraRecords.endsAt this.extraRecords.timezone}}
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
</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}}
{{general-date this.record this.extraRecords.timezone "D MMM, YYYY h:mm A (z)"}}
</span>
{{else if this.record}}
<span>
{{moment-format this.record (if this.props.options.dateFormat this.props.options.dateFormat 'MMMM DD, YYYY - HH:mm A')}}
{{moment-format 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>
{{moment-format this.record 'MMMM DD, YYYY - h:mm A'}}
{{moment-format this.record 'D MMM, YYYY h:mm A'}}
<br>To<br>
{{moment-format this.extraRecords.validTill 'MMMM DD, YYYY - h:mm A'}}
{{moment-format 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')}}
{{moment-format @record.completedAt 'MMMM DD, YYYY - hh:mm A'}}
{{moment-format @record.completedAt "D MMM, YYYY h:mm A"}}
{{else}}
{{moment-format @record.createdAt 'MMMM DD, YYYY - hh:mm A'}}
{{moment-format @record.createdAt "D MMM, YYYY h:mm A"}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
{{t 'Payment via'}} {{this.record.paidVia}}
</span>
{{/if}}
{{#if (eq this.record.status 'completed')}}
{{moment-format this.record.completedAt 'D MMM, YYYY h:mm A'}}
{{moment-from-now this.record.completedAt}}
{{else}}
{{moment-format this.record.createdAt 'D MMM, YYYY h:mm A'}}
{{moment-from-now this.record.createdAt}}
{{/if}}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span>
{{moment-format this.record 'MMMM Do YYYY, h:mm a'}}
{{moment-format this.record 'D MMM, YYYY h:mm A'}}
</span>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
{{t 'Payment via'}} {{this.extraRecords.paidVia}}
</span>
{{/if}}
<span class="muted text">
{{#if this.extraRecords.completedAt}}
{{moment-format this.extraRecords.completedAt 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.completedAt}}
{{else}}
{{moment-format this.extraRecords.createdAt 'D MMM, YYYY h:mm A'}} {{moment-from-now this.extraRecords.createdAt}}
{{/if}}
</span>
</div>
</div>
<div class="ui horizontal compact basic buttons">
Expand Down
4 changes: 2 additions & 2 deletions app/templates/event-invoice/review.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<strong>{{t 'Event Name'}}:</strong> {{this.model.event.name}}
</div>
<div class="item">
<strong>{{t 'Date Issued'}}:</strong> {{general-date this.model.issuedAt 'UTC' 'MMMM DD, YYYY'}}
<strong>{{t 'Date Issued'}}:</strong> {{general-date this.model.issuedAt 'UTC' 'D MMM, YYYY'}}
</div>
<div class="item">
<strong>{{t 'Due Date'}}:</strong> {{general-date this.model.dueAt 'UTC' 'MMMM DD, YYYY'}}
<strong>{{t 'Due Date'}}:</strong> {{general-date this.model.dueAt 'UTC' 'D MMM, YYYY'}}
</div>
<div class="item">
<strong>{{t 'Total Invoice Amount'}}:</strong> {{currency-symbol this.model.event.paymentCurrency}} {{format-money this.model.amount}}
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">
{{moment-format this.filters.start_date 'ddd, MMM DD'}}
{{moment-format 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">
{{moment-format this.filters.end_date 'ddd, MMM DD'}}
{{moment-format 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
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">{{header-date this.model.startsAt this.model.timezone}}</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changed to general

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to move to a single helper, general-date

<h4 class="event time">{{general-date this.model.startsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</h4>
{{#if this.displayEndDate}}
<h5 class="event time ends">{{t 'To'}} {{header-date this.model.endsAt this.model.timezone}}</h5>
<h5 class="event time ends">{{t 'To'}} {{general-date this.model.endsAt this.model.timezone 'dddd, D MMMM, YYYY h:mm A (z)'}}</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
2 changes: 1 addition & 1 deletion 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">{{moment-format date 'ddd, MMM Do'}}</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">{{moment-format date 'D MMM, YYYY'}}</LinkTo>
{{/each}}

<Widgets::TimeZonePicker
Expand Down