Skip to content

Commit

Permalink
Fix vuestorefront#3102 - Date Filter ignoring format. Use format object
Browse files Browse the repository at this point in the history
  • Loading branch information
David Grimason committed Jul 4, 2019
1 parent 30e8271 commit 70a0556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/filters/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { currentStoreView } from '@vue-storefront/core/lib/multistore'
/**
* Converts date to format provided as an argument or defined in config file (if argument not provided)
* @param {String} date
* @param {String} format
* @param {Object} format
*/
export function date (date, format) {
export function date (date, format = {}) {
const storeView = currentStoreView()
return new Date(date).toLocaleString(storeView.i18n.defaultLocale)
return new Date(date).toLocaleString(storeView.i18n.defaultLocale, format)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- My order body -->
<div class="row fs16 mb20">
<div class="col-xs-12 h4">
<p>{{ order.created_at | date('MMMM D, YYYY') }}</p>
<p>{{ order.created_at | date({year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric'}) }}</p>
<p class="mt35">
<a href="#" class="underline" @click.prevent="remakeOrder(skipGrouped(order.items))">{{ $t('Remake order') }}</a>
</p>
Expand Down

0 comments on commit 70a0556

Please sign in to comment.