From c4cfdd8e5e47ce75ab0cf132b3d66a2a3ba0a860 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 11 May 2025 17:26:11 -0600 Subject: [PATCH] refactor(habits): make PerformedOn datetime format explicit Explicitly set the `PerformedOn` field's datetime validation format in `TrackHabitActivityRequest` to `2006-01-02T15:04:05Z07:00` (RFC3339). This change replaces the generic `datetime` validator tag to improve code clarity and ensure the expected input format is self-documenting. It assumes the previous default validation behavior was already RFC3339, so no functional change to validation logic is intended. --- lunatask/habits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lunatask/habits.go b/lunatask/habits.go index 72805c14fc9e0a4df405f9000420fda3c9abcfe5..8593a2cec2c4365545e011059bb4aa61400e8778 100644 --- a/lunatask/habits.go +++ b/lunatask/habits.go @@ -19,7 +19,7 @@ import ( // TrackHabitActivityRequest represents the request to track a habit activity type TrackHabitActivityRequest struct { - PerformedOn string `json:"performed_on" validate:"required,datetime"` + PerformedOn string `json:"performed_on" validate:"required,datetime=2006-01-02T15:04:05Z07:00"` } // TrackHabitActivityResponse represents the response from Lunatask API when tracking a habit activity