Skip to content

Instantly share code, notes, and snippets.

@sairam
Created April 8, 2017 09:09
Show Gist options
  • Save sairam/99f463f177394f2111bae1128d0edb75 to your computer and use it in GitHub Desktop.
Save sairam/99f463f177394f2111bae1128d0edb75 to your computer and use it in GitHub Desktop.
Git Notify Patch for gopkg.in/robfig/cron.v2
diff --git a/spec.go b/spec.go
index 3dfd3e0..f895f42 100644
--- a/spec.go
+++ b/spec.go
@@ -114,7 +114,7 @@ WRAP:
for 1<<uint(t.Hour())&s.Hour == 0 {
if !added {
added = true
- t = t.Truncate(time.Hour)
+ t = time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, s.Location)
}
t = t.Add(1 * time.Hour)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment