mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 19:22:14 +01:00
add support for interval / duration format in frontend views
This commit is contained in:
committed by
Constantin Graf
parent
b8d9bc5b7e
commit
c1d43bcc67
@@ -6,16 +6,19 @@ import TaskMoreOptionsDropdown from '@/Components/Common/Task/TaskMoreOptionsDro
|
||||
import TableRow from '@/Components/TableRow.vue';
|
||||
import { canDeleteTasks } from '@/utils/permissions';
|
||||
import TaskEditModal from '@/Components/Common/Task/TaskEditModal.vue';
|
||||
import { ref } from 'vue';
|
||||
import { ref, inject, type ComputedRef } from 'vue';
|
||||
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
|
||||
import EstimatedTimeProgress from '@/packages/ui/src/EstimatedTimeProgress.vue';
|
||||
import UpgradeBadge from '@/Components/Common/UpgradeBadge.vue';
|
||||
import { formatHumanReadableDuration } from '../../../packages/ui/src/utils/time';
|
||||
import type { Organization } from '@/packages/api/src';
|
||||
|
||||
const props = defineProps<{
|
||||
task: Task;
|
||||
}>();
|
||||
|
||||
const organization = inject<ComputedRef<Organization>>('organization');
|
||||
|
||||
function deleteTask() {
|
||||
useTasksStore().deleteTask(props.task.id);
|
||||
}
|
||||
@@ -41,7 +44,13 @@ const showTaskEditModal = ref(false);
|
||||
<div
|
||||
class="whitespace-nowrap px-3 py-4 text-sm text-text-secondary flex space-x-1 items-center font-medium">
|
||||
<span v-if="task.spent_time">
|
||||
{{ formatHumanReadableDuration(task.spent_time) }}
|
||||
{{
|
||||
formatHumanReadableDuration(
|
||||
task.spent_time,
|
||||
organization?.interval_format,
|
||||
organization?.number_format
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
<span v-else> -- </span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user