MCPcopy
hub / github.com/pocketbase/pocketbase / TestDateTimeSub

Function TestDateTimeSub

tools/types/datetime_test.go:95–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestDateTimeSub(t *testing.T) {
96 t.Parallel()
97
98 d1, _ := types.ParseDateTime("2024-01-01 10:00:00.123Z")
99 d2, _ := types.ParseDateTime("2024-01-01 10:30:00.123Z")
100
101 result := d2.Sub(d1)
102
103 if result.Minutes() != 30 {
104 t.Fatalf("Expected %v minutes diff, got %v", 30, result.Minutes())
105 }
106}
107
108func TestDateTimeAddDate(t *testing.T) {
109 t.Parallel()

Callers

nothing calls this directly

Calls 2

ParseDateTimeFunction · 0.92
SubMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…