2017-09-26 10:47:19 +00:00
|
|
|
<script>
|
2018-10-10 06:09:55 +00:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
time: {
|
|
|
|
type: Object,
|
|
|
|
required: false,
|
|
|
|
default: () => ({}),
|
2017-09-26 10:47:19 +00:00
|
|
|
},
|
2018-10-10 06:09:55 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
hasData() {
|
|
|
|
return Object.keys(this.time).length;
|
2017-09-26 10:47:19 +00:00
|
|
|
},
|
2018-10-10 06:09:55 +00:00
|
|
|
},
|
|
|
|
};
|
2017-09-26 10:47:19 +00:00
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<span class="total-time">
|
|
|
|
<template v-if="hasData">
|
2018-01-05 14:31:01 +00:00
|
|
|
<template v-if="time.days">
|
2018-11-16 20:07:38 +00:00
|
|
|
{{ time.days }} <span> {{ n__('day', 'days', time.days) }} </span>
|
2018-01-05 14:31:01 +00:00
|
|
|
</template>
|
|
|
|
<template v-if="time.hours">
|
2018-11-16 20:07:38 +00:00
|
|
|
{{ time.hours }} <span> {{ n__('Time|hr', 'Time|hrs', time.hours) }} </span>
|
2018-01-06 18:59:49 +00:00
|
|
|
</template>
|
2018-01-05 14:31:01 +00:00
|
|
|
<template v-if="time.mins && !time.days">
|
2018-11-16 20:07:38 +00:00
|
|
|
{{ time.mins }} <span> {{ n__('Time|min', 'Time|mins', time.mins) }} </span>
|
2018-01-06 18:59:49 +00:00
|
|
|
</template>
|
2018-11-16 20:07:38 +00:00
|
|
|
<template v-if="(time.seconds && hasData === 1) || time.seconds === 0">
|
|
|
|
{{ time.seconds }} <span> {{ s__('Time|s') }} </span>
|
2018-01-06 18:59:49 +00:00
|
|
|
</template>
|
2017-09-26 10:47:19 +00:00
|
|
|
</template>
|
2020-12-23 12:10:26 +00:00
|
|
|
<template v-else> -- </template>
|
2018-01-08 20:01:49 +00:00
|
|
|
</span>
|
2017-09-26 10:47:19 +00:00
|
|
|
</template>
|