Skip to content

Commit

Permalink
[BUGFIX] Use moment.unix for visualizing regular unix timestamps
Browse files Browse the repository at this point in the history
A dialog trying to prevent overriding existing files in the filelist
module shows an incorrect modification date of files that are existing
on the server-side. When using regular unix timestamps (instead of
micro-timestamps), dedicated `moment.unix` function has to be used.

Resolves: #97724
Releases: main, 11.5, 10.4
Change-Id: Ieb5a00aaf87410e9721e39d91b9e0da13a109bc6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74816
Tested-by: core-ci <typo3@b13.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
ohader authored and andreaskienast committed Jun 10, 2022
1 parent 3b0a699 commit d41679a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface UploadedFile {
// formatted as ddmmyy
date: string;

mtime: Date;
mtime: number;
thumbUrl: string;
type: string;
}
Expand Down Expand Up @@ -362,7 +362,7 @@ class DragUploaderPlugin {
),
$('<td />').html(
this.askForOverride[i].original.name + ' (' + (DragUploader.fileSizeAsString(this.askForOverride[i].original.size)) + ')' +
'<br>' + moment(this.askForOverride[i].original.mtime).format('YYYY-MM-DD HH:mm'),
'<br>' + moment.unix(this.askForOverride[i].original.mtime).format('YYYY-MM-DD HH:mm'),
),
$('<td />').html(
this.askForOverride[i].uploaded.name + ' (' + (DragUploader.fileSizeAsString(this.askForOverride[i].uploaded.size)) + ')' +
Expand Down
Loading

0 comments on commit d41679a

Please sign in to comment.