Documentation
¶
Overview ¶
Calculates the liturgical properties for the specified date Ported from AGES Initiatives Java version. The original liturgical day properties was written by John Holder of St. Catherine Greek Orthodox Church in Denver, Colorado. The golang version was ported by Michael Colburn, OCMC.
Index ¶
- Constants
- Variables
- func ComputeDayOfPascha(year int, isUserCalendarGregorian bool) time.Time
- func DiffMillis(d1, d2 time.Time) int64
- func NewDate(year, month, day int) time.Time
- type LDP
- func (ldp *LDP) ComputeSundayAfterElevationOfCross(elevationOfCross time.Time) time.Time
- func (ldp *LDP) F()
- func (ldp *LDP) GetModeOfWeek() int
- func (ldp *LDP) GetMonthOfSundayAfterElevationOfCross() int
- func (ldp *LDP) OverrideMovableCycleDay(d int)
- func (ldp *LDP) ResetDate()
- func (ldp *LDP) SetDateStartLukanCycle()
- func (ldp *LDP) SetDayOfSeason()
- func (ldp *LDP) SetDayOfWeek()
- func (ldp *LDP) SetLiturgicalPropertiesByDate(year int)
- func (ldp *LDP) SetNumberOfSundaysBeforeStartOfTriodion()
- func (ldp *LDP) SetNumberOfSundaysBeforeStartOfTriodionOnJan15()
- func (ldp *LDP) SetVariablesToDefaults()
- func (ldp *LDP) SetYesterday()
- func (ldp *LDP) StrDay() string
- func (ldp *LDP) StrMonth() string
- func (ldp *LDP) StrYear() string
- func (ldp *LDP) TimeDelta(dateFrom time.Time, days int) time.Time
- func (ldp *LDP) WeekDay() string
Constants ¶
const ShortForm = "2019-10-25"
used as the format to create a date
Variables ¶
var GreekMap = map[string]string{
"Ιανουάριος": "Ἰανουαρίου",
"Φεβρουάριος": "Φεβρουαρίου",
"Μάρτιος": "Μαρτίου",
"Απρίλιος": "Ἀπριλίου",
"Μάϊος": "Μαΐου",
"Ιούνιος": "Ἰουνίου",
"Ιούλιος": "Ἰουλίου",
"Αύγουστος": "Αὐγούστου",
"Σεπτέμβριος": "Σεπτεμβρίου",
"Οκτώβριος": "Ὀκτωβρίου",
"Νοέμβριος": "Νοεμβρίου",
"Δεκέμβριος": "Δεκεμβρίου",
"Σάββατο": "τοῦ Σαββάτου",
"Κυριακή": "τῆς Κυριακῆς",
"Δευτέρα": "τῆς Δευτέρας",
"Τρίτη": "τῆς Τρίτης",
"Τετάρτη": "τῆς Τετάρτης",
"Πέμπτη": "τῆς Πέμπτης",
"Παρασκευή": "τῆς Παρασκευῆς",
"1": "αʹ",
"2": "βʹ",
"3": "γʹ",
"4": "δʹ",
"5": "εʹ",
"6": "Ϛʹ",
"7": "ζʹv",
"8": "ηʹ",
"9": "θʹ",
"10": "ιʹ",
"11": "ιαʹ",
"12": "ιβʹ",
"13": "ιγʹ",
"14": "ιδʹ",
"15": "ιεʹ",
"16": "ιϚʹ",
"17": "ιζʹ",
"18": "ιηʹ",
"19": "ιθʹ",
"20": "κʹ",
"21": "καʹ",
"22": "κβʹ",
"23": "κγʹ",
"24": "κδʹ",
"25": "κεʹ",
"26": "κϚʹ",
"27": "κζʹ",
"28": "κηʹ",
"29": "κθʹ",
"30": "λʹ",
"31": "λαʹ",
}
var GreekMonthDays = []string{
"αʹ",
"βʹ",
"γʹ",
"δʹ",
"εʹ",
"Ϛʹ",
"ζʹ",
"ηʹ",
"θʹ",
"ιʹ",
"ιαʹ",
"ιβʹ",
"ιγʹ",
"ιδʹ",
"ιεʹ",
"ιϚʹ",
"ιζʹ",
"ιηʹ",
"ιθʹ",
"κʹ",
"καʹ",
"κβʹ",
"κγʹ",
"κδʹ",
"κεʹ",
"κϚʹ",
"κζʹ",
"κηʹ",
"κθʹ",
"λʹ",
"λαʹ",
}
var GreekMonths = []string{"Ἰανουαρίου",
"Φεβρουαρίου",
"Μαρτίου",
"Ἀπριλίου",
"Μαΐου",
"Ἰουνίου",
"Ἰουλίου",
"Αὐγούστου",
"Σεπτεμβρίου",
"Ὀκτωβρίου",
"Νοεμβρίου",
"Δεκεμβρίου",
}
var GreekWeekDays = []string{
"τοῦ Σαββάτου",
"τῆς Κυριακῆς",
"τῆς Δευτέρας",
"τῆς Τρίτης",
"τῆς Τετάρτης",
"τῆς Πέμπτης",
"τῆς Παρασκευῆς",
}
Functions ¶
func ComputeDayOfPascha ¶
pass in the year and receive the month and day of Pascha.
func DiffMillis ¶
TODO: figure out a way to see if this works properly when one date is within daylight savings and the other is not
Types ¶
type LDP ¶
type LDP struct { TheDay time.Time AllSaintsDateLastYear time.Time AllSaintsDateThisYear time.Time DayOfSeason int // return 1..70 (0 if no day set). Valid only when isPentecostarion or isTriodion. DayOfWeek string // for debugging output DayOfWeekOverride string // for debugging output DaysSinceStartLastLukanCycle int DaysSinceStartOfTriodion int DaysSinceSundayAfterLastElevationOfCross int DaysUntilStartOfTriodion int // Used to control lectionary and commemorations ElevationOfCrossDateLast time.Time EothinonNumber int // 0..11. Valid values for 11 week cycle, only valid on Sundays!!!! GreatLentStartDate time.Time IsDaysOfLuke bool IsFriday bool IsMonday bool IsPascha bool IsPentecostarion bool IsSaturday bool IsSunday bool IsThursday bool IsTriodion bool IsTuesday bool IsWednesday bool LazarusSaturdayNextDate time.Time ModeOfWeek int // return 0..8 ModeOfWeekOverride int NbrDayOfMonth string NbrDayOfWeek string NbrDayOfWeekOverride string NbrMonth string NumberOfSundaysBeforeStartOfTriodion int PalmSundayDate time.Time PalmSundayNextDate time.Time PaschaDateLast time.Time PaschaDateLastYear time.Time PaschaDateNext time.Time PaschaDateThisYear time.Time PentecostDate time.Time StartDateOfLukanCycleLast time.Time SundayAfterElevationOfCrossDateLast time.Time TheDayBefore time.Time ThomasSundayDate time.Time TriodionStartDateLast time.Time TriodionStartDateLastYear time.Time TriodionStartDateNextYear time.Time TriodionStartDateThisYear time.Time // contains filtered or unexported fields }
LDP is the main struct for liturgical day properties
func NewLDPMD ¶
Returns a new LDP initialized to the specified month and day. The year is set to the current one.
func (*LDP) ComputeSundayAfterElevationOfCross ¶
func (*LDP) GetModeOfWeek ¶
func (*LDP) GetMonthOfSundayAfterElevationOfCross ¶
func (*LDP) OverrideMovableCycleDay ¶
func (*LDP) SetDateStartLukanCycle ¶
func (ldp *LDP) SetDateStartLukanCycle()
func (*LDP) SetDayOfSeason ¶
func (ldp *LDP) SetDayOfSeason()
func (*LDP) SetDayOfWeek ¶
func (ldp *LDP) SetDayOfWeek()
func (*LDP) SetLiturgicalPropertiesByDate ¶
func (*LDP) SetNumberOfSundaysBeforeStartOfTriodion ¶
func (ldp *LDP) SetNumberOfSundaysBeforeStartOfTriodion()
func (*LDP) SetNumberOfSundaysBeforeStartOfTriodionOnJan15 ¶
func (ldp *LDP) SetNumberOfSundaysBeforeStartOfTriodionOnJan15()
func (*LDP) SetVariablesToDefaults ¶
func (ldp *LDP) SetVariablesToDefaults()
Because the date can be reset for an instance of this class, it is necessary to reset certain variables to their default value. Otherwise, there value can carry over erroneously to a new date.
func (*LDP) SetYesterday ¶
func (ldp *LDP) SetYesterday()