()
| 21 | } |
| 22 | |
| 23 | func ExampleAddWeek() { |
| 24 | date, _ := time.Parse("2006-01-02", "2021-01-01") |
| 25 | |
| 26 | after2Weeks := AddWeek(date, 2) |
| 27 | before2Weeks := AddWeek(date, -2) |
| 28 | |
| 29 | fmt.Println(after2Weeks.Format("2006-01-02")) |
| 30 | fmt.Println(before2Weeks.Format("2006-01-02")) |
| 31 | |
| 32 | // Output: |
| 33 | // 2021-01-15 |
| 34 | // 2020-12-18 |
| 35 | } |
| 36 | |
| 37 | func ExampleAddMonth() { |
| 38 | date, _ := time.Parse("2006-01-02", "2021-01-01") |