Get duration in human time

This commit is contained in:
Râu Cao
2023-01-11 14:10:35 +08:00
parent fe27b010da
commit 6c7de97e38
2 changed files with 47 additions and 0 deletions
+7
View File
@@ -1,6 +1,7 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
import moment from 'moment';
export default class ConfirmedInComponent extends Component {
@service kredits;
@@ -20,4 +21,10 @@ export default class ConfirmedInComponent extends Component {
// A new block is mined every 30 seconds on average
return this.confirmedInBlocks * 30;
}
get confirmedInHumanTime () {
console.debug(this.confirmedInBlocks);
console.debug(this.confirmedInSeconds);
return moment.duration(this.confirmedInSeconds, "seconds").humanize();
}
}