Skip to content

Commit

Permalink
fix(list-view): sort work around
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 30, 2020
1 parent 93c1786 commit 823c4a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/pages/manager/fileMode/listView/listView.component.ts
Expand Up @@ -74,14 +74,15 @@ export class ListViewComponent implements OnInit, OnDestroy {
{ key: 'manipulation', title: '', width: '3%', searchEnabled: false, orderEnabled: false },
{ key: 'TypeIcon', title: '', width: '3%', searchEnabled: false },
{ key: 'Name', title: 'Name', width: '50%' },
{ key: 'SizeHumanReadable', title: 'Size', width: '10%' },
{ key: 'ModTimeHumanReadable', title: 'Modified Time', width: '17%' },
{ key: 'Size', title: 'Size', width: '10%' },
{ key: 'ModTimeMoment', title: 'Modified Time', width: '17%' },
{ key: 'MimeType', title: 'MIME Type', width: '17%' },
];

public data: (OperationsListFlowOutItemNode & {
SizeHumanReadable: string;
ModTimeHumanReadable: string;
ModTimeMoment: moment.Moment;
TypeIcon: string;
})[];
public check: boolean[];
Expand Down Expand Up @@ -145,7 +146,8 @@ export class ListViewComponent implements OnInit, OnDestroy {
this.data = x[0].list as any;
this.data.forEach((x) => {
x.SizeHumanReadable = FormatBytes(x.Size);
x.ModTimeHumanReadable = moment(x.ModTime).fromNow();
x.ModTimeMoment = moment(x.ModTime);
x.ModTimeHumanReadable = x.ModTimeMoment.fromNow();
if (x.IsDir) x.TypeIcon = getIconForFolder(x.Name);
else x.TypeIcon = getIconForFile(x.Name);
});
Expand Down

0 comments on commit 823c4a7

Please sign in to comment.