ethiopian_calendar

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: ISC Imports: 1 Imported by: 0

README

ethiopian-calendar

Ethiopian calendar and feasts library for Go

Installation

Install using go get as:

go get github.com/lgirma/ethiopian-calendar

Usage

Date Conversions

To convert a date in Ethiopian calendar to Gregorian calendar, use ToGregorian() as:

// Convert 8/10/2014 from EC to GC
ethcal.ToGregorian(ethcal.NewDate(2014, 10, 8))

To convert a date in Gregorian calendar to Ethiopian calendar, use ToEthiopian() as:

// Convert 01/01/2022 from GC to EC
ethcal.ToEthiopian(ethcal.NewDate(2022, 01, 01))
Moving Feasts

The Easter and related feasts in the Ethiopian Orthodox Tewahedo Church are not pinned to specific dates.

To get on which day of year a feast will be at:

// Get date of start of the 'Tsome Nenewe' (fast of Nineveh) for the year 2014 in Ethiopian Calendar
ethcal.GetNineveh(2014)  // Same as GetNenewe()

// Get date of start of the Great lent for the year 2014 in Ethiopian Calendar
ethcal.GetFeast(ethcal.FEAST_ABIY_TSOM, 2014)

// Get date of Easter for the year 2013 in Ethiopian Calendar
ethcal.GetFeast(ethcal.FEAST_TINSAE, 2013)

The following feasts are available:

FEAST_ABIY_TSOM = 14            // Or can use FEAST_GREAT_LENT
FEAST_DEBREZEIT = 41
FEAST_HOSAENA = 62
FEAST_SIQLET = 67               // Or can use FEAST_GOOD_FRIDAY
FEAST_TINSAE = 69               // Or can use FEAST_EASTER
FEAST_RIKBE_KAHINAT = 93
FEAST_ERGET = 108               // Or can use FEAST_ASCENSION
FEAST_PERAQLITOS = 118          // Or can use FEAST_PENTECOST
FEAST_TSOME_HAWARIAT = 119      // Or can use FEAST_APOSTLES_FAST
i18n Utilities

Utilities to convert date and month values to Amharic/Geez strings are also available.

// Indices starting from 1.

ethcal.MONTH_NAMES[1]
ethcal.MONTH_NAMES[ethcal.MONTH_SEP]
// Both return "መስከረም"

ethcal.DAY_NAMES[2]
ethcal.DAY_NAMES[ethcal.DAY_WED]
// Both return "ረቡዕ"

ethcal.EVANGELISTS_NAMES[1]
ethcal.EVANGELISTS_NAMES[etcal.EVANGELIST_MARK]
// Both return "ማርቆስ"

License

ISC License

Documentation

Index

Constants

View Source
const DAY_FRI = 5
View Source
const DAY_MON = 1
View Source
const DAY_SAT = 6
View Source
const DAY_SUN = 7
View Source
const DAY_THU = 4
View Source
const DAY_TUE = 2
View Source
const DAY_WED = 3
View Source
const EVANGELIST_JOHN = 4
View Source
const EVANGELIST_LUKE = 3
View Source
const EVANGELIST_MARK = 2
View Source
const EVANGELIST_MATTHEW = 1
View Source
const FEAST_ABIY_TSOM = 14
View Source
const FEAST_APOSTLES_FAST = 119
View Source
const FEAST_ASCENSION = 108
View Source
const FEAST_DEBREZEIT = 41
View Source
const FEAST_EASTER = 69
View Source
const FEAST_ERGET = 108
View Source
const FEAST_GOOD_FRIDAY = 67
View Source
const FEAST_GREAT_LENT = 14
View Source
const FEAST_HOSAENA = 62
View Source
const FEAST_PENTECOST = 118
View Source
const FEAST_PERAQLITOS = 118
View Source
const FEAST_RIKBE_KAHINAT = 93
View Source
const FEAST_SIQLET = 67
View Source
const FEAST_TINSAE = 69
View Source
const FEAST_TSOME_HAWARIAT = 119
View Source
const MONTH_APR = 8
View Source
const MONTH_AUG = 12
View Source
const MONTH_DEC = 4
View Source
const MONTH_FEB = 6
View Source
const MONTH_GINBOT = 9
View Source
const MONTH_HAMLE = 11
View Source
const MONTH_HIDAR = 3
View Source
const MONTH_JAN = 5
View Source
const MONTH_JUL = 11
View Source
const MONTH_JUN = 10
View Source
const MONTH_MAR = 7
View Source
const MONTH_MAY = 9
View Source
const MONTH_MEGABIT = 7
View Source
const MONTH_MESKEREM = 1
View Source
const MONTH_MIYAZIYA = 8
View Source
const MONTH_NEHASE = 12
View Source
const MONTH_NOV = 3
View Source
const MONTH_OCT = 2
View Source
const MONTH_PAGUMEN = 13
View Source
const MONTH_SENE = 10
View Source
const MONTH_SEP = 1
View Source
const MONTH_TAHISAS = 4
View Source
const MONTH_TIKIMT = 2
View Source
const MONTH_TIR = 5
View Source
const MONTH_YEKATIT = 6

Variables

View Source
var DAY_NAMES = []string{
	"",
	"ሰኞ",
	"ማክሰኞ",
	"ረቡዕ",
	"ኀሙስ",
	"ዐርብ",
	"ቅዳሜ",
	"እሑድ",
}

DAY_NAMES A lookup of names of week days starting from 1.

View Source
var EVANGELISTS_NAMES = []string{
	"",
	"ማቴዎስ",
	"ማርቆስ",
	"ሉቃስ",
	"ዮሐንስ",
}

EVANGELISTS_NAMES A lookup of names of the four evangelists starting from 1.

View Source
var GetNenewe = GetNineveh
View Source
var MONTH_NAMES = []string{
	"",
	"መስከረም",
	"ጥቅምት",
	"ኅዳር",
	"ታኅሣሥ",
	"ጥር",
	"የካቲት",
	"መጋቢት",
	"ሚያዝያ",
	"ግንቦት",
	"ሰኔ",
	"ሐምሌ",
	"ነሐሴ",
	"ጳጕሜን",
}

MONTH_NAMES A lookup of months of the year starting from 1.

Functions

func GetEvangelist

func GetEvangelist(year int) int

func GetMeTq

func GetMeTq(year int) int

func GetMebacha

func GetMebacha(year int) int

func GetRabit

func GetRabit(year int) int

func GetWenber

func GetWenber(year int) int

Types

type Date

type Date struct {
	Day   int
	Month int
	Year  int
}

Date Represents a date structure with Day, Month and Year

func NewDate

func NewDate(year int, month int, day int) Date

NewDate Creates a new Date structure

func ToEthiopian

func ToEthiopian(gcDate Date) Date

ToEthiopian Converts given date in Gregorian calendar to Ethiopian calendar

func ToGregorian

func ToGregorian(ecDate Date) Date

ToGregorian Converts given date in Ethiopian calendar to Gregorian calendar

type DayOfYear

type DayOfYear struct {
	Day   int
	Month int
}

DayOfYear Represents a date structure with Day and Month

func GetFeast

func GetFeast(feast int, year int) DayOfYear

func GetFeastFromNineveh

func GetFeastFromNineveh(feast int, nineveh DayOfYear) DayOfYear

func GetMebajaHamer

func GetMebajaHamer(year int) DayOfYear

func GetNineveh

func GetNineveh(year int) DayOfYear

func NewDay

func NewDay(month int, day int) DayOfYear

NewDay Creates a new DayOfYear structure

Jump to

Keyboard shortcuts

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