Fix: proper sorting resources by age column (#2182)

* - fix: proper sorting for resource age column
- use Date.now() instead of new Date().getTime() (#2141 follow-up)

Signed-off-by: Roman <ixrock@gmail.com>

* fix: proper bar-chart tooltip callback

Signed-off-by: Roman <ixrock@gmail.com>

* fix: sorting in cronjobs, more Date.now() replacements

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman authored and GitHub committed 2021-02-19 14:21:07 +02:00
1 parent e87bb850fb
commit 82d8181938
31 files changed
+42 -40

No files matched your search

@@ -198,10 +198,9 @@ export class HelmRelease implements ItemObject {
}
getUpdated(humanize = true, compact = true) {
const now = new Date().getTime();
const updated = this.updated.replace(/\s\w*$/, ""); // 2019-11-26 10:58:09 +0300 MSK -> 2019-11-26 10:58:09 +0300 to pass into Date()
const updatedDate = new Date(updated).getTime();
const diff = now - updatedDate;
const diff = Date.now() - updatedDate;
if (humanize) {
return formatDuration(diff, compact);
@@ -63,10 +63,12 @@ export class PersistentVolume extends KubeObject {
return this.status.phase || "-";
}
getClaimRefName() {
const { claimRef } = this.spec;
getStorageClass(): string {
return this.spec.storageClassName;
}
return claimRef ? claimRef.name : "";
getClaimRefName(): string {
return this.spec.claimRef?.name ?? "";
}
}
+1 -1
View File
@@ -123,7 +123,7 @@ export class KubeObject implements ItemObject {
}
getTimeDiffFromNow(): number {
return new Date().getTime() - new Date(this.metadata.creationTimestamp).getTime();
return Date.now() - new Date(this.metadata.creationTimestamp).getTime();
}
getAge(humanize = true, compact = true, fromNow = false): string | number {