Documentation
¶
Overview ¶
Package persian is part of the carbon package.
Index ¶
- Variables
- type Locale
- type Persian
- func (p *Persian) Day() int
- func (p *Persian) IsLeapYear() bool
- func (p *Persian) IsValid() bool
- func (p *Persian) Month() int
- func (p *Persian) String() string
- func (p *Persian) ToGregorian(timezone ...string) *calendar.Gregorian
- func (p *Persian) ToMonthString(locale ...Locale) (month string)
- func (p *Persian) ToWeekString(locale ...Locale) (month string)
- func (p *Persian) Year() int
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnMonths = []string{"Farvardin", "Ordibehesht", "Khordad", "Tir", "Mordad", "Shahrivar", "Mehr", "Aban", "Azar", "Dey", "Bahman", "Esfand"} FaMonths = []string{"فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"} EnWeeks = []string{"Yekshanbeh", "Doshanbeh", "Seshanbeh", "Chaharshanbeh", "Panjshanbeh", "Jomeh", "Shanbeh"} FaWeeks = []string{"نجشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"} )
Functions ¶
This section is empty.
Types ¶
type Persian ¶
type Persian struct {
Error error
// contains filtered or unexported fields
}
Persian defines a Persian struct.
func FromStdTime ¶ added in v2.6.2
FromStdTime creates a Persian instance from standard time.Time.
func NewPersian ¶ added in v2.6.2
NewPersian returns a new Persian instance.
func (*Persian) IsLeapYear ¶
IsLeapYear reports whether the Persian year is a leap year.
func (*Persian) ToGregorian ¶
ToGregorian converts Persian instance to Gregorian instance.
func (*Persian) ToMonthString ¶
ToMonthString outputs a string in Persian month format like "فروردین".
func (*Persian) ToWeekString ¶
ToWeekString outputs a string in week layout like "چهارشنبه".
Click to show internal directories.
Click to hide internal directories.