forked from dromara/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstellation_example_test.go
135 lines (109 loc) · 2.78 KB
/
constellation_example_test.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package carbon_test
import (
"fmt"
"github.com/dromara/carbon/v2"
)
func ExampleCarbon_Constellation() {
fmt.Println(carbon.Parse("2020-01-05").Constellation())
fmt.Println(carbon.Parse("2020-02-05").Constellation())
fmt.Println(carbon.Parse("2020-03-05").Constellation())
fmt.Println(carbon.Parse("2020-04-05").Constellation())
fmt.Println(carbon.Parse("2020-05-05").Constellation())
fmt.Println(carbon.Parse("2020-06-05").Constellation())
fmt.Println(carbon.Parse("2020-07-05").Constellation())
fmt.Println(carbon.Parse("2020-08-05").Constellation())
fmt.Println(carbon.Parse("2020-09-05").Constellation())
fmt.Println(carbon.Parse("2020-10-05").Constellation())
fmt.Println(carbon.Parse("2020-11-05").Constellation())
fmt.Println(carbon.Parse("2020-12-05").Constellation())
// Output:
// Capricorn
// Aquarius
// Pisces
// Aries
// Taurus
// Gemini
// Cancer
// Leo
// Virgo
// Libra
// Scorpio
// Sagittarius
}
func ExampleCarbon_IsAries() {
fmt.Println(carbon.Parse("2020-04-20").IsTaurus())
fmt.Println(carbon.Parse("2020-08-05").IsTaurus())
// Output:
// true
// false
}
func ExampleCarbon_IsGemini() {
fmt.Println(carbon.Parse("2020-06-21").IsGemini())
fmt.Println(carbon.Parse("2020-08-05").IsGemini())
// Output:
// true
// false
}
func ExampleCarbon_IsCancer() {
fmt.Println(carbon.Parse("2020-06-22").IsCancer())
fmt.Println(carbon.Parse("2020-08-05").IsCancer())
// Output:
// true
// false
}
func ExampleCarbon_IsLeo() {
fmt.Println(carbon.Parse("2020-07-23").IsLeo())
fmt.Println(carbon.Parse("2020-09-01").IsLeo())
// Output:
// true
// false
}
func ExampleCarbon_IsVirgo() {
fmt.Println(carbon.Parse("2020-08-23").IsVirgo())
fmt.Println(carbon.Parse("2020-08-05").IsVirgo())
// Output:
// true
// false
}
func ExampleCarbon_IsLibra() {
fmt.Println(carbon.Parse("2020-09-23").IsLibra())
fmt.Println(carbon.Parse("2020-08-05").IsLibra())
// Output:
// true
// false
}
func ExampleCarbon_IsScorpio() {
fmt.Println(carbon.Parse("2020-10-24").IsScorpio())
fmt.Println(carbon.Parse("2020-08-05").IsScorpio())
// Output:
// true
// false
}
func ExampleCarbon_IsSagittarius() {
fmt.Println(carbon.Parse("2020-11-23").IsSagittarius())
fmt.Println(carbon.Parse("2020-08-05").IsSagittarius())
// Output:
// true
// false
}
func ExampleCarbon_IsCapricorn() {
fmt.Println(carbon.Parse("2020-12-22").IsCapricorn())
fmt.Println(carbon.Parse("2020-08-05").IsCapricorn())
// Output:
// true
// false
}
func ExampleCarbon_IsAquarius() {
fmt.Println(carbon.Parse("2020-01-20").IsAquarius())
fmt.Println(carbon.Parse("2020-08-05").IsAquarius())
// Output:
// true
// false
}
func ExampleCarbon_IsPisces() {
fmt.Println(carbon.Parse("2020-02-19").IsPisces())
fmt.Println(carbon.Parse("2020-08-05").IsPisces())
// Output:
// true
// false
}