ldp

package
v0.0.0-...-e6ef1c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2019 License: EPL-2.0 Imports: 4 Imported by: 0

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

View Source
const ShortForm = "2019-10-25"

used as the format to create a date

Variables

View Source
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":          "λαʹ",
}
View Source
var GreekMonthDays = []string{
	"αʹ",
	"βʹ",
	"γʹ",
	"δʹ",
	"εʹ",
	"Ϛʹ",
	"ζʹ",
	"ηʹ",
	"θʹ",
	"ιʹ",
	"ιαʹ",
	"ιβʹ",
	"ιγʹ",
	"ιδʹ",
	"ιεʹ",
	"ιϚʹ",
	"ιζʹ",
	"ιηʹ",
	"ιθʹ",
	"κʹ",
	"καʹ",
	"κβʹ",
	"κγʹ",
	"κδʹ",
	"κεʹ",
	"κϚʹ",
	"κζʹ",
	"κηʹ",
	"κθʹ",
	"λʹ",
	"λαʹ",
}
View Source
var GreekMonths = []string{"Ἰανουαρίου",
	"Φεβρουαρίου",
	"Μαρτίου",
	"Ἀπριλίου",
	"Μαΐου",
	"Ἰουνίου",
	"Ἰουλίου",
	"Αὐγούστου",
	"Σεπτεμβρίου",
	"Ὀκτωβρίου",
	"Νοεμβρίου",
	"Δεκεμβρίου",
}
View Source
var GreekWeekDays = []string{
	"τοῦ Σαββάτου",
	"τῆς Κυριακῆς",
	"τῆς Δευτέρας",
	"τῆς Τρίτης",
	"τῆς Τετάρτης",
	"τῆς Πέμπτης",
	"τῆς Παρασκευῆς",
}

Functions

func ComputeDayOfPascha

func ComputeDayOfPascha(year int, isUserCalendarGregorian bool) time.Time

pass in the year and receive the month and day of Pascha.

func DiffMillis

func DiffMillis(d1, d2 time.Time) int64

TODO: figure out a way to see if this works properly when one date is within daylight savings and the other is not

func NewDate

func NewDate(year, month, day int) time.Time

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 NewLDP

func NewLDP() (LDP, error)

Returns a new LDP initialized for today's date

func NewLDPMD

func NewLDPMD(month, day int) (LDP, error)

Returns a new LDP initialized to the specified month and day. The year is set to the current one.

func NewLDPYMD

func NewLDPYMD(year, month, day int) (LDP, error)

Creates a new LDP initialized to the specified date

func (*LDP) ComputeSundayAfterElevationOfCross

func (ldp *LDP) ComputeSundayAfterElevationOfCross(elevationOfCross time.Time) time.Time

func (*LDP) F

func (ldp *LDP) F()

func (*LDP) GetModeOfWeek

func (ldp *LDP) GetModeOfWeek() int

func (*LDP) GetMonthOfSundayAfterElevationOfCross

func (ldp *LDP) GetMonthOfSundayAfterElevationOfCross() int

func (*LDP) OverrideMovableCycleDay

func (ldp *LDP) OverrideMovableCycleDay(d int)

func (*LDP) ResetDate

func (ldp *LDP) ResetDate()

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 *LDP) SetLiturgicalPropertiesByDate(year int)

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()

func (*LDP) StrDay

func (ldp *LDP) StrDay() string

func (*LDP) StrMonth

func (ldp *LDP) StrMonth() string

func (*LDP) StrYear

func (ldp *LDP) StrYear() string

func (*LDP) TimeDelta

func (ldp *LDP) TimeDelta(dateFrom time.Time, days int) time.Time

func (*LDP) WeekDay

func (ldp *LDP) WeekDay() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL