repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
32a8a51
parent
395c5eb
author
Eric Bower
date
2024-04-01 01:29:21 +0000 UTC
fix(analytics): better first day of month calc
1 files changed,  +3, -1
M shared/util.go
+3, -1
 1@@ -153,9 +153,11 @@ func BytesToGB(size int) float32 {
 2 	return (((float32(size) / 1024) / 1024) / 1024)
 3 }
 4 
 5+// https://stackoverflow.com/a/46964105
 6 func StartOfMonth() time.Time {
 7 	now := time.Now()
 8-	return now.AddDate(0, 0, -now.Day()+1)
 9+	firstday := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.UTC)
10+	return firstday
11 }
12 
13 func StartOfYear() time.Time {