Skip to content
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
2 changes: 1 addition & 1 deletion app/components/public/add-to-calender.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{#if this.isSingleDay}}
{{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 "dddd, D MMMM, YYYY h:mm A" [email protected]}} {{t 'to'}} {{general-date @event.endsAt "dddd, D MMMM, YYYY h:mm A" [email protected]}}
{{general-date @event.startsAt 'date-time-long' [email protected]}} {{t 'to'}} {{general-date @event.endsAt 'date-time-long' [email protected]}}
{{/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 'D MMM, YYYY h:mm A (z)' tz=@timezone}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt 'date-time-tz-short' tz=@timezone}}</div>
{{/if}}
</div>
{{/if}}
Expand Down
5 changes: 1 addition & 4 deletions app/controllers/admin/messages/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ get columns() {
valuePath : 'sentAt',
headerComponent : 'tables/headers/sort',
isSortable : true,
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
cellComponent : 'ui-table/cell/cell-simple-date'
}

];
Expand Down
15 changes: 3 additions & 12 deletions app/controllers/admin/sessions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,21 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
valuePath : 'submittedAt',
cellComponent : 'ui-table/cell/cell-simple-date',
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
headerComponent : 'tables/headers/sort'
},
{
name : this.l10n.t('Starts At'),
valuePath : 'startsAt',
cellComponent : 'ui-table/cell/cell-simple-date',
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
headerComponent : 'tables/headers/sort'
},
{
name : this.l10n.t('Ends At'),
valuePath : 'endsAt',
cellComponent : 'ui-table/cell/cell-simple-date',
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
headerComponent : 'tables/headers/sort'
},
{
name : this.l10n.t('Actions'),
Expand Down
10 changes: 2 additions & 8 deletions app/controllers/admin/users/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,14 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
valuePath : 'createdAt',
cellComponent : 'ui-table/cell/cell-simple-date',
isSortable : true,
headerComponent : 'tables/headers/sort',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
headerComponent : 'tables/headers/sort'
},
{
name : this.l10n.t('Last Accessed'),
valuePath : 'lastAccessedAt',
isSortable : true,
headerComponent : 'tables/headers/sort',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'D MMM, YYYY h:mm A'
}
cellComponent : 'ui-table/cell/cell-simple-date'
}
];
}
Expand Down
10 changes: 2 additions & 8 deletions app/controllers/events/view/sessions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,13 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
name : this.l10n.t('Submission Date'),
width : 90,
valuePath : 'submittedAt',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'D MMM, YYYY h:mm A (z)'
}
cellComponent : 'ui-table/cell/cell-simple-date'
Copy link
Contributor

Choose a reason for hiding this comment

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

Timezone is not showing.

sa1

expected

ka 1

Copy link
Member

Choose a reason for hiding this comment

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

Not needed here

},
{
name : this.l10n.t('Last Modified'),
width : 90,
valuePath : 'lastModifiedAt',
cellComponent : 'ui-table/cell/cell-simple-date',
options : {
dateFormat: 'D MMM, YYYY h:mm A (z)'
}
cellComponent : 'ui-table/cell/cell-simple-date'
},
{
name : this.l10n.t('Notify'),
Expand Down
1 change: 0 additions & 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,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/events/view/tickets/orders/cell-date',
headerComponent : 'tables/headers/sort',
width : 100,
dateFormat : 'D MMM, YYYY h:mm A (z)',
isSortable : true
},
{
Expand Down
13 changes: 11 additions & 2 deletions app/helpers/general-date.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import Helper from '@ember/component/helper';
import moment from 'moment';

const dateFormats = {
'date-time-long' : 'dddd, D MMMM, YYYY h:mm A',
'date-time-tz-long' : 'dddd, D MMMM, YYYY h:mm A (z)',
'date-time-short' : 'D MMM, YYYY h:mm A',
'date-time-tz-short' : 'D MMM, YYYY h:mm A (z)',
'date-short' : 'D MMM, YYYY',
'time-tz-short' : 'h:mm A (z)'
};

const locales12Hours = new Set(['en', 'bn', 'hi', 'id', 'ja', 'run', 'th', 'vi', 'ko']);

export function generalDate(params, { tz }) {
const timezone = tz || moment.tz.guess();

const local = moment(params[0]).tz(timezone).locale();

let format = params[1] || 'h:mm A, MMMM Do YYYY (z)';
let format = (dateFormats[params[1]] || params[1]) || 'h:mm A, MMMM Do YYYY (z)';

if (!locales12Hours.has(local)) {
format = format.replaceAll('h', 'H');
format = format.replace(/h/g, 'H');
format = format.replace(' A', '');
format = format.replace(' a', '');
}
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 'date-short'}}
</td>
<td class="right aligned">
{{order.ticketCount}}
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 'date-time-long'}}
<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 'date-time-long'}}
{{#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 'date-short'}}</td>
<td>{{general-date this.data.completedAt 'date-short'}}</td>
<td>{{currency-symbol this.eventCurrency}} {{format-money this.data.amount}}</td>
</tr>
</tbody>
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 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.order.event.timezone}}
{{general-date this.order.event.startsAt 'date-time-tz-long' 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 'date-time-short'}}</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 'date-time-long'}}
<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 'date-time-long'}}
{{#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 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.data.speakersCall.event.timezone}}
{{t 'Call for Speakers is open until'}} {{general-date this.data.speakersCall.endsAt 'date-time-tz-long' 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 'dddd, D MMMM, YYYY h:mm A (z)' tz=this.data.speakersCall.event.timezone}}
{{t 'Call for Speakers will open at'}} {{general-date this.data.speakersCall.endsAt 'date-time-tz-long' tz=this.data.speakersCall.event.timezone}}
{{else}}
{{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}}
{{t 'Call for Speakers was closed at'}} {{general-date this.data.speakersCall.endsAt 'date-time-tz-long' tz=this.data.speakersCall.event.timezone}}
{{/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 {{general-date ticket.salesEndsAt 'dddd, D MMMM, YYYY h:mm A (z)' [email protected]}}</small>
<small class="ui gray-text small">Sale ends on {{general-date ticket.salesEndsAt 'date-time-tz-long' [email protected]}}</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}}
{{general-date this.session.startsAt 'D MMM, YYYY h:mm A'}}
{{general-date this.session.startsAt 'date-time-short'}}
{{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 "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
{{general-date this.record 'date-time-tz-short' tz=this.extraRecords.timezone}}
</div>
(to)
<div>
{{general-date this.record "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
{{general-date this.record 'date-time-tz-short' 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 "D MMM, YYYY h:mm A (z)" tz=this.extraRecords.timezone}}
{{general-date this.record 'date-time-tz-short' 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 'date-time-short')}}
</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 'date-time-short'}}
<br>To<br>
{{general-date this.extraRecords.validTill 'D MMM, YYYY h:mm A'}}
{{general-date this.extraRecords.validTill 'date-time-short'}}
</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 'date-time-short'}}
{{else}}
{{general-date @record.createdAt "D MMM, YYYY h:mm A"}}
{{general-date @record.createdAt 'date-time-short'}}
{{/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 'date-time-short'}}
{{moment-from-now this.record.completedAt}}
{{else}}
{{general-date this.record.createdAt 'D MMM, YYYY h:mm A'}}
{{general-date this.record.createdAt 'date-time-short'}}
{{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 'date-time-short'}}
</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 'date-time-short'}}
</div>
{{else}}
<div>
{{general-date this.extraRecords.createdAt 'D MMM, YYYY h:mm A'}}
{{general-date this.extraRecords.createdAt 'date-time-short'}}
</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 'date-time-short'}} {{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 'date-time-short'}} {{moment-from-now this.extraRecords.createdAt}}
{{/if}}
</span>
</div>
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' 'D MMM, YYYY'}}
<strong>{{t 'Date Issued'}}:</strong> {{general-date this.model.issuedAt 'date-short' tz='UTC'}}
</div>
<div class="item">
<strong>{{t 'Due Date'}}:</strong> {{general-date this.model.dueAt 'UTC' 'D MMM, YYYY'}}
<strong>{{t 'Due Date'}}:</strong> {{general-date this.model.dueAt 'date-short' tz='UTC'}}
</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">
{{general-date this.filters.start_date 'D MMM, YYYY'}}
{{general-date this.filters.start_date 'date-short'}}
<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 'date-short'}}
<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 'date-time-long'}} - {{general-date this.model.event.endsAt 'date-time-long'}}
<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 'date-time-long'}} - {{general-date this.model.order.event.endsAt 'date-time-long'}}
<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 'date-time-long'}} - {{general-date this.model.order.event.endsAt 'date-time-long'}}
<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 'date-time-long'}} - {{general-date this.model.order.event.endsAt 'date-time-long'}}
<br>
{{this.model.order.event.locationName}}
</div>
Expand Down
Loading