From 4c29dfee9be26996ce548e2edf0328422df598d0 Mon Sep 17 00:00:00 2001 From: T Date: Mon, 4 Aug 2025 10:41:08 -0600 Subject: Fix time query parameters to force them to datetime format --- internal/commands/import.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/commands/import.go') diff --git a/internal/commands/import.go b/internal/commands/import.go index a767923..a1d0d8f 100644 --- a/internal/commands/import.go +++ b/internal/commands/import.go @@ -186,9 +186,13 @@ func importSingleEntry(q *queries.Queries, entry clockifyEntry, loc *time.Locati projectID = sql.NullInt64{Int64: project.ID, Valid: true} } + // Format times as SQLite-compatible strings for the datetime() function + startTimeStr := startTime.UTC().Format(time.DateTime) + endTimeStr := endTime.UTC().Format(time.DateTime) + _, err = q.CreateTimeEntryWithTimes(context.Background(), queries.CreateTimeEntryWithTimesParams{ - StartTime: startTime.UTC(), - EndTime: sql.NullTime{Time: endTime.UTC(), Valid: true}, + StartTime: startTimeStr, + EndTime: endTimeStr, Description: sql.NullString{String: entry.Description, Valid: entry.Description != ""}, ClientID: client.ID, ProjectID: projectID, -- cgit v1.2.3