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

@@ -50,7 +50,7 @@ describe("human format durations", () => {
});
test("durations less than 8 years returns years and days", () => {
const timeValue = new Date().getTime() - new Date(moment().subtract(2, "years").subtract(5, "days").subtract(2, "hours").toDate()).getTime();
const timeValue = Date.now() - new Date(moment().subtract(2, "years").subtract(5, "days").subtract(2, "hours").toDate()).getTime();
const res = formatDuration(timeValue);
@@ -58,7 +58,7 @@ describe("human format durations", () => {
});
test("durations more than 8 years returns years", () => {
const timeValue = new Date().getTime() - new Date(moment().subtract(9, "years").subtract(5, "days").toDate()).getTime();
const timeValue = Date.now() - new Date(moment().subtract(9, "years").subtract(5, "days").toDate()).getTime();
const res = formatDuration(timeValue);