Initial commit

This commit is contained in:
Michael committed 2026-08-06 18:26:45 +12:00
commit b6014c6ffc
47 files changed
+4329

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
package handlers
import "time"
const dateLayout = "2006-01-02"
// parseOptionalDate parses a "YYYY-MM-DD" string, treating nil/empty as no
// value. Used for the optional date fields on car/reminder inputs.
func parseOptionalDate(s *string) (*time.Time, error) {
if s == nil || *s == "" {
return nil, nil
}
t, err := time.Parse(dateLayout, *s)
if err != nil {
return nil, err
}
return &t, nil
}