Skip to content
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

Show dates browser-localized #167

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions resources/assets/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
* Format the given date.
*/
Vue.filter('date', value => {
return moment.utc(value).local().format('MMMM Do, YYYY')
return moment.utc(value).local().format('LL')
});


/**
* Format the given date as a timestamp.
*/
Vue.filter('datetime', value => {
return moment.utc(value).local().format('MMMM Do, YYYY h:mm A');
return moment.utc(value).local().format('LL LT');
});


/**
* Format the given date into a relative time.
*/
Vue.filter('relative', value => {
return moment.utc(value).local().locale('en-short').fromNow();
return moment.utc(value).local().fromNow();
});


Expand Down Expand Up @@ -66,4 +66,4 @@ Vue.filter('currency', value => {
return sign + window.Spark.currencySymbol + head +
_int.slice(i).replace(/(\d{3})(?=\d)/g, '$1,') +
_float;
});
});
4 changes: 2 additions & 2 deletions resources/assets/js/mixins/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ module.exports = {

if (this.onGenericTrial) {
return moment.utc(this.billable.trial_ends_at)
.local().format('MMMM Do, YYYY');
.local().format('LL');
}

return moment.utc(this.activeSubscription.trial_ends_at)
.local().format('MMMM Do, YYYY');
.local().format('LL');
},


Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/spark-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ window.moment.defineLocale('en-short', {
yy: "%dy"
}
});
window.moment.locale('en');
window.moment.locale(window.navigator.language);

/*
* Load jQuery and Bootstrap jQuery, used for front-end interaction.
Expand Down