tangled
alpha
login
or
join now
shindakun.net
/
attodo.app
3
fork
atom
The attodo.app, uhh... app.
3
fork
atom
overview
issues
pulls
pipelines
timezones are hard
Steve Layton
3 months ago
6f59511e
42d32765
+11
-9
3 changed files
expand all
collapse all
unified
split
internal
handlers
lists.go
render.go
tasks.go
+5
-4
internal/handlers/lists.go
···
208
208
}
209
209
210
210
// Create new list
211
211
+
now := time.Now().UTC()
211
212
list := &models.TaskList{
212
213
Name: name,
213
214
Description: r.FormValue("description"),
214
215
TaskURIs: []string{}, // Empty initially
215
215
-
CreatedAt: time.Now(),
216
216
-
UpdatedAt: time.Now(),
216
216
+
CreatedAt: now,
217
217
+
UpdatedAt: now,
217
218
}
218
219
219
220
// Build record
···
330
331
list.Name = name
331
332
}
332
333
list.Description = r.FormValue("description")
333
333
-
list.UpdatedAt = time.Now()
334
334
+
list.UpdatedAt = time.Now().UTC()
334
335
335
336
// Handle task URI updates if provided
336
337
if taskURIsJSON := r.FormValue("taskUris"); taskURIsJSON != "" {
···
436
437
}
437
438
438
439
// Update timestamp
439
439
-
list.UpdatedAt = time.Now()
440
440
+
list.UpdatedAt = time.Now().UTC()
440
441
441
442
// Build record and update
442
443
updatedRecord := buildListRecord(list)
+2
-2
internal/handlers/render.go
···
20
20
"formatDate": func(t interface{}) string {
21
21
switch v := t.(type) {
22
22
case time.Time:
23
23
-
return v.Format("Jan 2, 2006 3:04 PM")
23
23
+
return v.Local().Format("Jan 2, 2006 3:04 PM")
24
24
case *time.Time:
25
25
if v != nil {
26
26
-
return v.Format("Jan 2, 2006 3:04 PM")
26
26
+
return v.Local().Format("Jan 2, 2006 3:04 PM")
27
27
}
28
28
return ""
29
29
default:
+4
-3
internal/handlers/tasks.go
···
152
152
}
153
153
154
154
// Create task record
155
155
+
now := time.Now().UTC()
155
156
record := map[string]interface{}{
156
157
"$type": TaskCollection,
157
158
"title": title,
158
159
"description": description,
159
160
"completed": false,
160
160
-
"createdAt": time.Now().Format(time.RFC3339),
161
161
+
"createdAt": now.Format(time.RFC3339),
161
162
}
162
163
163
164
// Try to create record with retry logic
···
183
184
Title: title,
184
185
Description: description,
185
186
Completed: false,
186
186
-
CreatedAt: time.Now(),
187
187
+
CreatedAt: now,
187
188
RKey: rkey,
188
189
URI: output.Uri,
189
190
}
···
235
236
236
237
// Update completedAt based on completion status
237
238
if task.Completed {
238
238
-
now := time.Now()
239
239
+
now := time.Now().UTC()
239
240
task.CompletedAt = &now
240
241
} else {
241
242
task.CompletedAt = nil