mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: sorting in cronjobs, more Date.now() replacements
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
7256abd846
commit
1d2a7f9170
@ -46,7 +46,7 @@ export class CronJobs extends React.Component<Props> {
|
|||||||
[columnId.suspend]: (cronJob: CronJob) => cronJob.getSuspendFlag(),
|
[columnId.suspend]: (cronJob: CronJob) => cronJob.getSuspendFlag(),
|
||||||
[columnId.active]: (cronJob: CronJob) => cronJobStore.getActiveJobsNum(cronJob),
|
[columnId.active]: (cronJob: CronJob) => cronJobStore.getActiveJobsNum(cronJob),
|
||||||
[columnId.lastSchedule]: (cronJob: CronJob) => cronJob.getLastScheduleTime(),
|
[columnId.lastSchedule]: (cronJob: CronJob) => cronJob.getLastScheduleTime(),
|
||||||
[columnId.age]: (cronJob: CronJob) => cronJob.metadata.creationTimestamp,
|
[columnId.age]: (cronJob: CronJob) => cronJob.getTimeDiffFromNow(),
|
||||||
}}
|
}}
|
||||||
searchFilters={[
|
searchFilters={[
|
||||||
(cronJob: CronJob) => cronJob.getSearchFields(),
|
(cronJob: CronJob) => cronJob.getSearchFields(),
|
||||||
|
|||||||
@ -50,7 +50,7 @@ describe("human format durations", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("durations less than 8 years returns years and days", () => {
|
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);
|
const res = formatDuration(timeValue);
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ describe("human format durations", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("durations more than 8 years returns years", () => {
|
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);
|
const res = formatDuration(timeValue);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user