summaryrefslogtreecommitdiff
path: root/internal/tui/modal.go
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-08 10:57:56 -0600
committerT <t@tjp.lol>2025-08-12 14:45:56 -0600
commitdaea67322cd387c2caf8f1a326c90b4276c6e9bc (patch)
treeda1d2a85e530640a1ed804fece38da30940e7dd5 /internal/tui/modal.go
parent54c791927b2851fb6739ed75897090c3c39ecca1 (diff)
bugfixes
Diffstat (limited to 'internal/tui/modal.go')
-rw-r--r--internal/tui/modal.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/tui/modal.go b/internal/tui/modal.go
index 167b659..9a72336 100644
--- a/internal/tui/modal.go
+++ b/internal/tui/modal.go
@@ -92,7 +92,7 @@ func (m ModalBoxModel) Render() string {
func (m ModalBoxModel) RenderFormModal(title string) string {
return fmt.Sprintf(
- "%s\n\n%s\n\n%s Delete %s Cancel",
+ "%s\n\n%s\n\n%s Submit %s Cancel",
modalTitleStyle.Render(title),
m.form.View(),
boldStyle.Render("[Enter]"),
@@ -231,22 +231,22 @@ func (m *ModalBoxModel) validateAndParseEntryForm(am AppModel) (queries.EditTime
entry, _ := am.queries.GetTimeEntryById(context.Background(), params.EntryID)
startTimeStr := m.form.fields[0].Value()
- startTime, err := time.Parse(time.DateTime, startTimeStr)
+ startTime, err := time.ParseInLocation(time.DateTime, startTimeStr, time.Local)
if err != nil {
m.form.fields[0].Err = fmt.Errorf("invalid start time format")
hasErrors = true
} else {
- params.StartTime = startTime
+ params.StartTime = startTime.UTC().Format(time.DateTime)
}
endTimeStr := m.form.fields[1].Value()
if endTimeStr != "" {
- endTime, err := time.Parse(time.DateTime, endTimeStr)
+ endTime, err := time.ParseInLocation(time.DateTime, endTimeStr, time.Local)
if err != nil {
m.form.fields[1].Err = fmt.Errorf("invalid end time format")
hasErrors = true
} else {
- params.EndTime = sql.NullTime{Time: endTime, Valid: true}
+ params.EndTime = endTime.UTC().Format(time.DateTime)
}
} else if entry.EndTime.Valid {
m.form.fields[1].Err = fmt.Errorf("can not re-open an entry")