- {{ entry.title || 'Sans titre' }}
+
+
{{ entry.title || 'Sans titre' }}
+
{{ duration }}
+
{{ entry.project.name }}
-
+
+
{{ type.label }}
- {{ duration }}
{{ entry.title || 'Sans titre' }}
- {{ duration }}
+ {{ duration }}
@@ -88,13 +90,11 @@ const resizeTopDeltaMinutes = ref(0)
const resizeBottomDeltaMinutes = ref(0)
const duration = computed(() => {
- const startMs = startDate.value.getTime() + resizeTopDeltaMinutes.value * 60000
- const endMs = endDate.value.getTime() + resizeBottomDeltaMinutes.value * 60000
- const diff = endMs - startMs
- const h = Math.floor(diff / 3600000)
- const m = Math.floor((diff % 3600000) / 60000)
- const s = Math.floor((diff % 60000) / 1000)
- return [h, m, s].map((v) => String(v).padStart(2, '0')).join(' : ')
+ const mins = Math.floor((endDate.value.getTime() + resizeBottomDeltaMinutes.value * 60000
+ - startDate.value.getTime() - resizeTopDeltaMinutes.value * 60000) / 60000)
+ const h = Math.floor(mins / 60)
+ const m = mins % 60
+ return m > 0 ? `${h}h${String(m).padStart(2, '0')}` : `${h}h`
})
const heightPx = computed(() => {
diff --git a/frontend/components/TimeEntryDrawer.vue b/frontend/components/TimeEntryDrawer.vue
index a3b2a17..7fcde22 100644
--- a/frontend/components/TimeEntryDrawer.vue
+++ b/frontend/components/TimeEntryDrawer.vue
@@ -57,37 +57,28 @@
{{ durationLabel }}
-
-
-
-
+
-
-
-
-
+
-
-
-
-
+
-
+
{{ currentMonthLabel }}
@@ -33,29 +33,35 @@
-
+ :options="userOptions"
+ min-width="!w-40"
+ text-field="text-sm"
+ text-value="text-sm"
+ label="User"
+ empty-option-label="User"
+ />
-
+ :options="projectOptions"
+ empty-option-label="Tous"
+ label="Projet"
+ min-width="!w-40"
+ text-field="text-sm"
+ text-value="text-sm"
+ />
-
+ :options="typeOptions"
+ empty-option-label="Tous"
+ label="Type"
+ min-width="!w-40"
+ text-field="text-sm"
+ text-value="text-sm"
+ />
@@ -145,6 +151,18 @@ const currentMonthLabel = computed(() => {
return `${months[d.getMonth()]} ${d.getFullYear()}`
})
+const userOptions = computed(() =>
+ users.value.map(u => ({ label: u.username, value: u.id }))
+)
+
+const projectOptions = computed(() =>
+ projects.value.map(p => ({ label: p.name, value: p.id }))
+)
+
+const typeOptions = computed(() =>
+ types.value.map(t => ({ label: t.label, value: t.id }))
+)
+
const filteredEntries = computed(() => {
let result = entries.value
if (selectedProjectId.value) {
@@ -284,4 +302,8 @@ watch(viewMode, () => {
startDate.value = viewMode.value === 'day' ? startDate.value : getMonday(startDate.value)
loadEntries()
})
+
+watch(selectedUserId, () => {
+ loadEntries()
+})