Documentation
¶
Overview ¶
Package lunar is part of the carbon package.
Index ¶
- type Lunar
- func (l *Lunar) Animal() string
- func (l *Lunar) Day() int
- func (l *Lunar) Festival() string
- func (l *Lunar) IsDogYear() bool
- func (l *Lunar) IsDragonYear() bool
- func (l *Lunar) IsGoatYear() bool
- func (l *Lunar) IsHorseYear() bool
- func (l *Lunar) IsLeapMonth() bool
- func (l *Lunar) IsLeapYear() bool
- func (l *Lunar) IsMonkeyYear() bool
- func (l *Lunar) IsOxYear() bool
- func (l *Lunar) IsPigYear() bool
- func (l *Lunar) IsRabbitYear() bool
- func (l *Lunar) IsRatYear() bool
- func (l *Lunar) IsRoosterYear() bool
- func (l *Lunar) IsSnakeYear() bool
- func (l *Lunar) IsTigerYear() bool
- func (l *Lunar) IsValid() bool
- func (l *Lunar) LeapMonth() int
- func (l *Lunar) Month() int
- func (l *Lunar) String() string
- func (l *Lunar) ToDateString() string
- func (l *Lunar) ToDayString() (day string)
- func (l *Lunar) ToGregorian(timezone ...string) *calendar.Gregorian
- func (l *Lunar) ToMonthString() (month string)
- func (l *Lunar) ToWeekString() (month string)
- func (l *Lunar) ToYearString() (year string)
- func (l *Lunar) Year() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lunar ¶
type Lunar struct {
Error error
// contains filtered or unexported fields
}
Lunar defines a Lunar struct.
func FromStdTime ¶ added in v2.6.2
FromStdTime creates a Lunar instance from standard time.Time.
func (*Lunar) IsDragonYear ¶
IsDragonYear reports whether is lunar year of Dragon.
func (*Lunar) IsGoatYear ¶
IsGoatYear reports whether is lunar year of Goat.
func (*Lunar) IsHorseYear ¶
IsHorseYear reports whether is lunar year of Horse.
func (*Lunar) IsLeapMonth ¶
IsLeapMonth reports whether is a lunar leap month.
func (*Lunar) IsLeapYear ¶
IsLeapYear reports whether is a lunar leap year.
func (*Lunar) IsMonkeyYear ¶
IsMonkeyYear reports whether is lunar year of Monkey.
func (*Lunar) IsRabbitYear ¶
IsRabbitYear reports whether is lunar year of Rabbit.
func (*Lunar) IsRoosterYear ¶
IsRoosterYear reports whether is lunar year of Rooster.
func (*Lunar) IsSnakeYear ¶
IsSnakeYear reports whether is lunar year of Snake.
func (*Lunar) IsTigerYear ¶
IsTigerYear reports whether is lunar year of Tiger.
func (*Lunar) ToDateString ¶
ToDateString outputs a string in lunar date format like "二零二零年腊月初五". 获取农历日期字符串,如 "二零二零年腊月初五"
func (*Lunar) ToDayString ¶
ToDayString outputs a string in lunar day format like "廿一".
func (*Lunar) ToGregorian ¶
ToGregorian converts Lunar instance to Gregorian instance.
func (*Lunar) ToMonthString ¶
ToMonthString outputs a string in lunar month format like "正月".
func (*Lunar) ToWeekString ¶
ToWeekString outputs a string in week layout like "周一".
func (*Lunar) ToYearString ¶
ToYearString outputs a string in lunar year format like "二零二零".