Skip to content

Commit 0dc7db8

Browse files
committed
统一代码风格
1 parent 8b77411 commit 0dc7db8

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

constellation.go

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ func (c Carbon) Constellation() string {
1010
if len(c.Lang.resources) == 0 && c.Lang.SetLocale(defaultLocale) != nil {
1111
return ""
1212
}
13-
1413
index := -1
1514
switch {
1615
case c.Month() == 3 && c.Day() >= 21, c.Month() == 4 && c.Day() <= 19:
@@ -40,12 +39,10 @@ func (c Carbon) Constellation() string {
4039
default:
4140
return ""
4241
}
43-
4442
if constellations, ok := c.Lang.resources["constellations"]; ok {
4543
slice := strings.Split(constellations, "|")
4644
return slice[index]
4745
}
48-
4946
return ""
5047
}
5148

parser.go

-6
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,16 @@ func (c Carbon) Parse(value string) Carbon {
1212
if c.Error != nil {
1313
return c
1414
}
15-
1615
layout := DateTimeFormat
17-
1816
if value == "" || value == "0" || value == "0000-00-00 00:00:00" || value == "0000-00-00" || value == "00:00:00" {
1917
return c
2018
}
21-
2219
if len(value) == 10 && strings.Count(value, "-") == 2 {
2320
layout = DateFormat
2421
}
25-
2622
if strings.Index(value, "T") == 10 {
2723
layout = RFC3339Format
2824
}
29-
3025
if _, err := strconv.ParseInt(value, 10, 64); err == nil {
3126
switch len(value) {
3227
case 8:
@@ -35,7 +30,6 @@ func (c Carbon) Parse(value string) Carbon {
3530
layout = ShortDateTimeFormat
3631
}
3732
}
38-
3933
return c.ParseByLayout(value, layout)
4034
}
4135

0 commit comments

Comments
 (0)