-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
66474: ui: jobs remaining time fix r=elkmaster a=elkmaster adjust format duration function to support more than 100 hours values Resolves: #65939 Release note(ui): fix issue with display more than 100hours remaining time on jobs page Co-authored-by: Vlad Los <carrott9@gmail.com>
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2018 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import { assert } from "chai"; | ||
import moment from "moment"; | ||
import { formatDuration } from "."; | ||
|
||
describe("Jobs", () => { | ||
it("format duration", () => { | ||
assert.equal(formatDuration(moment.duration(0)), "00:00:00"); | ||
assert.equal(formatDuration(moment.duration(5, "minutes")), "00:05:00"); | ||
assert.equal(formatDuration(moment.duration(5, "hours")), "05:00:00"); | ||
assert.equal(formatDuration(moment.duration(110, "hours")), "110:00:00"); | ||
assert.equal( | ||
formatDuration(moment.duration(12345, "hours")), | ||
"12345:00:00", | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters