Skip to content

Commit

Permalink
feat: display gifts date (#5081)
Browse files Browse the repository at this point in the history
  • Loading branch information
sktlmarat authored Apr 29, 2021
1 parent c0000fe commit a478fd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=2c20668056d05d81becf",
"/js/app.js": "/js/app.js?id=e4dd41d026dabae81573",
"/js/stripe.js": "/js/stripe.js?id=20c59848535dab33ed9e",
"/js/manifest.js": "/js/manifest.js?id=895f51a7a2cbcfaf0d03",
"/css/app-rtl.css": "/css/app-rtl.css?id=e976d220373bd82dfe46",
Expand Down
14 changes: 14 additions & 0 deletions resources/js/components/people/gifts/Gift.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.photo {
height: 200px;
}
.gift-date{
float: right;
}
</style>

<template>
Expand All @@ -13,6 +16,7 @@
</a>
<strong v-else>{{ gift.name }}</strong>
</span>
<span v-if="gift.date" class="f7 gift-date">{{ formatDate(gift.date) }}</span>

<span v-if="gift.recipient && gift.recipient.complete_name">
<span class="black-50 mr1 ml1">
Expand Down Expand Up @@ -101,6 +105,16 @@ export default {
this.$refs.modalPhoto.open();
},
formatDate(dateAsString) {
const moment = require('moment-timezone');
moment.locale(this._i18n.locale);
moment.tz.setDefault('UTC');
var date = moment.tz(moment(dateAsString), this.$root.timezone);
return date.format('LL');
},
}
};
</script>

0 comments on commit a478fd8

Please sign in to comment.