MCPcopy Index your code
hub / github.com/duke-git/lancet / ExampleAddWeek

Function ExampleAddWeek

datetime/datetime_example_test.go:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func 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
37func ExampleAddMonth() {
38 date, _ := time.Parse("2006-01-02", "2021-01-01")

Callers

nothing calls this directly

Calls 2

AddWeekFunction · 0.85
FormatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…