mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
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 ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user