From 21a6bd6d87de5aad9fa4d35348092a0e8fcf886a Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 22 Feb 2017 12:30:57 -0500 Subject: [PATCH] next-note: plumb this up to the vscode version --- cmd/next-note/main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/next-note/main.go b/cmd/next-note/main.go index 4804343..327bc92 100644 --- a/cmd/next-note/main.go +++ b/cmd/next-note/main.go @@ -21,22 +21,22 @@ func main() { if *flDate { // this intentionally has no '\n' - fmt.Printf("== %s", time.Now().Format(time.UnixDate)) + fmt.Printf("## %s", time.Now().Format(time.UnixDate)) return } - var monday int + var sunday int t := time.Now() if *flCurrWeek { - monday = -1*int(t.Weekday()) + 1 + sunday = -1 * int(t.Weekday()) } else if *flPrevWeek { - monday = -1*int(t.Weekday()) + 1 - 7 + sunday = -1*int(t.Weekday()) - 7 } else { - monday = -1*int(t.Weekday()) + 1 + 7 + sunday = -1*int(t.Weekday()) + 7 } - friday := monday + 4 - startDate := t.AddDate(0, 0, monday).Format(FileDate) - endDate := t.AddDate(0, 0, friday).Format(FileDate) - filename := fmt.Sprintf("Tasks-%s-%s.txt", startDate, endDate) + saturday := sunday + 6 + startDate := t.AddDate(0, 0, sunday).Format(FileDate) + endDate := t.AddDate(0, 0, saturday).Format(FileDate) + filename := fmt.Sprintf("Tasks-%s-%s.md", startDate, endDate) fmt.Println(path.Join(*flDir, filename)) }