Skip to content

Commit

Permalink
ui: show accurate duration
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Jan 23, 2020
1 parent bc67c0c commit 1f5dd1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@types/humanize-duration": "^3.18.0",
"@types/validator": "^12.0.1",
"@types/vue-moment": "^4.0.0",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.0.3",
"core-js": "^3.3.2",
"humanize-duration": "^3.21.0",
"validator": "^12.1.0",
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
Expand Down
3 changes: 2 additions & 1 deletion ui/src/views/CollectionShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ import { namespace } from 'vuex-class';
import * as CollectionStore from '../store/collection';
import CollectionStatusBadge from '@/components/CollectionStatusBadge.vue';
import moment from 'moment';
import humanizeDuration from 'humanize-duration';
import { api, EnduroCollectionClient } from '../client';
Expand All @@ -127,7 +128,7 @@ export default class CollectionShow extends Vue {
private took(created: Date, completed: Date): string {
const diff = moment(completed).diff(created);
return moment.duration(diff).humanize();
return humanizeDuration(moment.duration(diff).asMilliseconds());
}
private retry(id: string): Promise<any> {
Expand Down
10 changes: 10 additions & 0 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,11 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/humanize-duration@^3.18.0":
version "3.18.0"
resolved "https://registry.yarnpkg.com/@types/humanize-duration/-/humanize-duration-3.18.0.tgz#1de456980ff537a17cd62447f3d128bb57198d5a"
integrity sha512-11QHl+GvEQ5TlCjA9xqQKNv4S0P8XFq5uHeZe2UPjngESBl7tA1tai/60eEYwWMFWIyQOl7ybarYF0B33K3Qtg==

"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
Expand Down Expand Up @@ -4652,6 +4657,11 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

humanize-duration@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.21.0.tgz#ae5dc7e67640770cbf6a8d03a5d1138d47c7ce38"
integrity sha512-7BLsrQZ2nMGeakmGDUl1pDne6/7iAdvwf1RtDLCOPHNFIHjkOVW7lcu7xHkIM9HhZAlSSO5crhC1dHvtl4dIQw==

[email protected], iconv-lite@^0.4.4:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
Expand Down

0 comments on commit 1f5dd1a

Please sign in to comment.