Skip to content

Commit

Permalink
Simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Feb 18, 2024
1 parent 8322447 commit aeab4be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions calendar.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func (c Carbon) Lunar() (l lunar.Lunar) {
if c.Error != nil {
l.Error = c.Error
return l
return
}
return lunar.FromGregorian(c.StdTime()).ToLunar()
}
Expand All @@ -27,7 +27,7 @@ func CreateFromLunar(year, month, day, hour, minute, second int, isLeapMonth boo
// 将 Carbon 实例转化为 Julian 实例
func (c Carbon) Julian() (j julian.Julian) {
if c.Error != nil {
return j
return
}
return julian.FromGregorian(c.StdTime()).ToJulian()
}
Expand All @@ -41,9 +41,9 @@ func CreateFromJulian(f float64) Carbon {

// Persian converts Carbon instance to Persian instance.
// 将 Carbon 实例转化为 Persian 实例
func (c Carbon) Persian() (j persian.Persian) {
func (c Carbon) Persian() (p persian.Persian) {
if c.Error != nil {
return j
return
}
return persian.FromGregorian(c.StdTime()).ToPersian()
}
Expand Down

0 comments on commit aeab4be

Please sign in to comment.