forked from gofoji/pgtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intervals.go
70 lines (66 loc) · 1 KB
/
intervals.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package nodes
// IntervalModType is the internal bit mask for specifying things like "day to minute" or "year".
type IntervalModType uint32
// Interval types.
const (
Empty IntervalModType = 1 << iota
Month
Year
Day
Julian
TZ
DTZ
DynTZ
IgnoreDTF
AMPM
Hour
Minute
Second
MilliSecond
MicroSecond
DoY
DoW
Units
ADBC
AGO
ABSBefore
ABSAfter
ISODate
ISOTime
Week
Decade
Century
Millennium
DTZMod
)
func (i IntervalModType) String() string {
switch i {
case Month:
return "month"
case Year:
return "year"
case Day:
return "day"
case Hour:
return "hour"
case Minute:
return "minute"
case Second:
return "second"
case Year | Month:
return "year to month"
case Hour | Day:
return "day to hour"
case Day | Hour | Minute:
return "day to minute"
case Day | Hour | Minute | Second:
return "day to second"
case Hour | Minute:
return "hour to minute"
case Hour | Minute | Second:
return "hour to second"
case Minute | Second:
return "minute to second"
}
return ""
}