Skip to content

Commit

Permalink
File versions tooltip with absolute date (#9441)
Browse files Browse the repository at this point in the history
* file versions tooltip with absolute date

* add changelog
  • Loading branch information
elizavetaRa authored and AlexAndBear committed Dec 13, 2023
1 parent a9cb840 commit 1b7420f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/enhancement-absolute-date-file-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: File versions tooltip with absolute date

We've added a tooltip with the absolute date for file versions in file details

https://github.com/owncloud/web/pull/9441
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
>
<div class="version-details">
<span
v-oc-tooltip="formatVersionDate(item)"
class="version-date oc-font-semibold"
data-testid="file-versions-file-last-modified-date"
>{{ formatVersionDate(item) }}</span
>{{ formatVersionDateRelative(item) }}</span
>
-
<span class="version-filesize" data-testid="file-versions-file-size">{{
Expand Down Expand Up @@ -61,6 +62,7 @@ import { defineComponent, inject, ref, Ref } from 'vue'
import { isShareSpaceResource, Resource, SpaceResource } from 'web-client/src/helpers'
import { SharePermissions } from 'web-client/src/helpers/share'
import { useDownloadFile } from 'web-pkg/src/composables/download/useDownloadFile'
import { formatDateFromJSDate } from 'web-pkg/src/helpers'
export default defineComponent({
name: 'FileVersions',
Expand Down Expand Up @@ -136,12 +138,18 @@ export default defineComponent({
const version = this.currentVersionId(file)
return this.downloadFile(this.resource, version)
},
formatVersionDate(file) {
formatVersionDateRelative(file) {
return formatRelativeDateFromHTTP(
file.fileInfo[DavProperty.LastModifiedDate],
this.$language.current
)
},
formatVersionDate(file) {
return formatDateFromJSDate(
new Date(file.fileInfo[DavProperty.LastModifiedDate]),
this.$language.current
)
},
formatVersionFileSize(file) {
return formatFileSize(file.fileInfo[DavProperty.ContentLength], this.$language.current)
}
Expand Down

0 comments on commit 1b7420f

Please sign in to comment.