Skip to content

Commit

Permalink
Format dates in UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed May 9, 2023
1 parent 6534d31 commit 68ebc54
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/components/IncomingSignRequests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
<span v-if="request.signed">{{ request.filename }}</span>
</td>
<td>
{{ request.created }}
{{ formatDate(request.created) }}
</td>
<td>
{{ request.own_signed }}
{{ formatDate(request.own_signed) }}
</td>
<td>
<NcAvatar :user="request.user_id"
Expand Down Expand Up @@ -115,6 +115,7 @@
</template>

<script>
import moment from '@nextcloud/moment'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
Expand Down Expand Up @@ -197,6 +198,14 @@ export default {
elem.scrollIntoView()
},
formatDate(d) {
if (!d) {
return d
}
return moment(d).format('LLL')
},
async fetchRequests() {
this.loading = true
let response
Expand Down
13 changes: 11 additions & 2 deletions src/components/OwnSignRequests.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
{{ request.filename }}
</td>
<td>
{{ request.created }}
{{ formatDate(request.created) }}
</td>
<td>
{{ getLastSignature(request) }}
{{ formatDate(getLastSignature(request)) }}
</td>
<td>
<div v-for="recipient in request.recipients" :key="recipient.type + '-' + recipient.value">
Expand Down Expand Up @@ -103,6 +103,7 @@
</template>

<script>
import moment from '@nextcloud/moment'
import { showSuccess, showError } from '@nextcloud/dialogs'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
Expand Down Expand Up @@ -182,6 +183,14 @@ export default {
elem.scrollIntoView()
},
formatDate(d) {
if (!d) {
return d
}
return moment(d).format('LLL')
},
getLastSignature(request) {
if (request.signed) {
return request.signed
Expand Down

0 comments on commit 68ebc54

Please sign in to comment.