Skip to content

Commit

Permalink
[4.x] Localize revision dates (#9266)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga authored Jan 5, 2024
1 parent efcf3f9 commit a760cfc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion resources/js/components/revision-history/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
v-for="group in revisions"
:key="group.day"
>
<h6 class="revision-date" v-text="$moment.unix(group.day).isBefore($moment().startOf('day')) ? $moment.unix(group.day).format('LL') : __('Today')" />
<h6 class="revision-date" v-text="
$moment.unix(group.day).isBefore($moment().startOf('day'))
? $moment.unix(group.day).toDate().toLocaleDateString($config.get('locale').replace('_', '-'), { month: 'long', day: 'numeric', year: 'numeric' })
: __('Today')" />
<div class="revision-list">
<revision
v-for="revision in group.revisions"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/revision-history/Revision.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="flex-1">
<div class="revision-author text-gray-700 text-2xs">
<template v-if="revision.user">{{ revision.user.name || revision.user.email }} &ndash;</template>
{{ date.isBefore($moment().startOf('day')) ? date.format('LT') : date.fromNow() }}
{{ date.toDate().toLocaleTimeString($config.get('locale').replace('_', '-'), { hour: 'numeric', minute: '2-digit' }) }}
</div>
</div>

Expand Down

0 comments on commit a760cfc

Please sign in to comment.