mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
promote duration formats that omit seconds to HH:mm:ss in reporting
views and exports
This commit is contained in:
@@ -52,6 +52,7 @@ const props = defineProps<{
|
||||
selected?: boolean;
|
||||
canCreateProject: boolean;
|
||||
enableEstimatedTime: boolean;
|
||||
isReport?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{ selected: []; unselected: [] }>();
|
||||
@@ -172,6 +173,7 @@ async function handleDeleteTimeEntry() {
|
||||
<TimeEntryRowDurationInput
|
||||
:start="timeEntry.start"
|
||||
:end="timeEntry.end"
|
||||
:is-report="props.isReport"
|
||||
@changed="updateStartEndTime"></TimeEntryRowDurationInput>
|
||||
<TimeTrackerStartStop
|
||||
:active="!!(timeEntry.start && !timeEntry.end)"
|
||||
@@ -196,6 +198,7 @@ async function handleDeleteTimeEntry() {
|
||||
<TimeEntryRowDurationInput
|
||||
:start="timeEntry.start"
|
||||
:end="timeEntry.end"
|
||||
:is-report="props.isReport"
|
||||
@changed="updateStartEndTime"></TimeEntryRowDurationInput>
|
||||
</div>
|
||||
<!-- Second row: project/task - tags - billable - start - more -->
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import {
|
||||
calculateDifference,
|
||||
formatHumanReadableDuration,
|
||||
formatReportingDuration,
|
||||
parseTimeInput,
|
||||
} from '@/packages/ui/src/utils/time';
|
||||
import { computed, ref, inject, type ComputedRef } from 'vue';
|
||||
@@ -18,6 +19,7 @@ const organizationSettings = computed(() => ({
|
||||
const props = defineProps<{
|
||||
start: string;
|
||||
end: string | null;
|
||||
isReport?: boolean;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
changed: [start: string, end: string | null];
|
||||
@@ -51,7 +53,8 @@ const currentTime = computed({
|
||||
if (temporaryCustomTimerEntry.value !== '') {
|
||||
return temporaryCustomTimerEntry.value;
|
||||
}
|
||||
return formatHumanReadableDuration(
|
||||
const formatter = props.isReport ? formatReportingDuration : formatHumanReadableDuration;
|
||||
return formatter(
|
||||
calculateDifference(props.start, props.end),
|
||||
organizationSettings.value.intervalFormat,
|
||||
organizationSettings.value.numberFormat
|
||||
|
||||
Reference in New Issue
Block a user