當前位置: 首頁>>代碼示例>>Python>>正文


Python easter.EASTER_ORTHODOX屬性代碼示例

本文整理匯總了Python中dateutil.easter.EASTER_ORTHODOX屬性的典型用法代碼示例。如果您正苦於以下問題:Python easter.EASTER_ORTHODOX屬性的具體用法?Python easter.EASTER_ORTHODOX怎麽用?Python easter.EASTER_ORTHODOX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在dateutil.easter的用法示例。


在下文中一共展示了easter.EASTER_ORTHODOX屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testEasterOrthodox

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def testEasterOrthodox(self):
        for easter_date in orthodox_easter_dates:
            self.assertEqual(easter_date,
                             easter(easter_date.year, EASTER_ORTHODOX)) 
開發者ID:MediaBrowser,項目名稱:plugin.video.emby,代碼行數:6,代碼來源:test_easter.py

示例2: _populate

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def _populate(self, year):
        # New Year's Day
        name = "New Year's Day"
        self[date(year, 1, 1)] = name

        # Orthodox Christmas day
        name = "Orthodox Christmas Day"
        self[date(year, 1, 7)] = name

        # International Women's Day
        name = "International Women's Day"
        self[date(year, 3, 8)] = name

        # Commemoration Day
        name = "Commemoration Day"
        self[easter(year, EASTER_ORTHODOX) + timedelta(days=9)] = name

        # Spring and Labour Day
        name = "Spring and Labour Day"
        self[date(year, 5, 1)] = name

        # Victory Day
        name = "Victory Day"
        self[date(year, 5, 9)] = name

        # Independence Day
        name = "Independence Day"
        self[date(year, 7, 3)] = name

        # October Revolution Day
        name = "October Revolution Day"
        self[date(year, 11, 7)] = name

        # Dec. 25 Christmas Day
        name = "Christmas Day"
        self[date(year, 12, 25)] = name 
開發者ID:facebook,項目名稱:prophet,代碼行數:38,代碼來源:hdays.py

示例3: orthodox_easter

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def orthodox_easter(start_date='1980', end_date='2021'):
    """
    ASEX observes Orthodox Easter, and has many holidays
    that are relative to Orthodox Easter.  This function gives a
    DatetimeIndex of Orthodox Easter dates from start_date to end_date
    """
    return pd.to_datetime([
        easter(year, method=EASTER_ORTHODOX)
        for year in range(int(start_date), int(end_date))
    ]).tz_localize(UTC) 
開發者ID:quantopian,項目名稱:trading_calendars,代碼行數:12,代碼來源:exchange_calendar_asex.py

示例4: _populate

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def _populate(self, year):

        eday = easter(year, method=EASTER_ORTHODOX)

        # New Years
        self[date(year, JAN, 1)] = "Πρωτοχρονιά [New Year's Day]"
        # Epiphany
        self[date(year, JAN, 6)] = "Θεοφάνεια [Epiphany]"

        # Clean Monday
        self[eday - rd(days=48)] = "Καθαρά Δευτέρα [Clean Monday]"

        # Independence Day
        self[date(year, MAR, 25)] = "Εικοστή Πέμπτη Μαρτίου [Independence Day]"

        # Easter Monday
        self[eday + rd(days=1)] = "Δευτέρα του Πάσχα [Easter Monday]"

        # Labour Day
        self[date(year, MAY, 1)] = "Εργατική Πρωτομαγιά [Labour day]"

        # Monday of the Holy Spirit
        self[eday + rd(days=50)] = \
            "Δευτέρα του Αγίου Πνεύματος [Monday of the Holy Spirit]"

        # Assumption of Mary
        self[date(year, AUG, 15)] = "Κοίμηση της Θεοτόκου [Assumption of Mary]"

        # Ochi Day
        self[date(year, OCT, 28)] = "Ημέρα του Όχι [Ochi Day]"

        # Christmas
        self[date(year, DEC, 25)] = "Χριστούγεννα [Christmas]"

        # Day after Christmas
        self[date(year, DEC, 26)] = \
            "Επόμενη ημέρα των Χριστουγέννων [Day after Christmas]" 
開發者ID:dr-prodigy,項目名稱:python-holidays,代碼行數:39,代碼來源:greece.py

示例5: _populate

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def _populate(self, year):
        # The current set of holidays came into force in 1998
        # http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
        if year <= 1998:
            return

        # New Year's Day
        self[date(year, JAN, 1)] = "Новый год"

        # Jan 2nd is the national holiday (New Year) from 2020
        # http://president.gov.by/uploads/documents/2019/464uk.pdf
        if year >= 2020:
            # New Year's Day
            self[date(year, JAN, 2)] = "Новый год"

        # Christmas Day (Orthodox)
        self[date(year, JAN, 7)] = "Рождество Христово " \
                                   "(православное Рождество)"

        # Women's Day
        self[date(year, MAR, 8)] = "День женщин"

        # Radunitsa ("Day of Rejoicing")
        self[easter(year, method=EASTER_ORTHODOX) + rd(days=9)] = "Радуница"

        # Labour Day
        self[date(year, MAY, 1)] = "Праздник труда"

        # Victory Day
        self[date(year, MAY, 9)] = "День Победы"

        # Independence Day
        self[date(year, JUL, 3)] = "День Независимости Республики Беларусь " \
                                   "(День Республики)"

        # October Revolution Day
        self[date(year, NOV, 7)] = "День Октябрьской революции"

        # Christmas Day (Catholic)
        self[date(year, DEC, 25)] = "Рождество Христово " \
                                    "(католическое Рождество)" 
開發者ID:dr-prodigy,項目名稱:python-holidays,代碼行數:43,代碼來源:belarus.py

示例6: _populate

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def _populate(self, year):
        # New Year's Day
        name = "Нова година"
        self[date(year, JAN, 1)] = name
        self[date(year, JAN, 2)] = name
        if self.observed and date(year, JAN, 1).weekday() in WEEKEND:
            self[date(year, JAN, 3)] = name + " (Observed)"
        # Orthodox Christmas
        name = "Божић"
        self[date(year, JAN, 7)] = name
        # Statehood day
        name = "Дан државности Србије"
        self[date(year, FEB, 15)] = name
        self[date(year, FEB, 16)] = name
        if self.observed and date(year, FEB, 15).weekday() in WEEKEND:
            self[date(year, FEB, 17)] = name + " (Observed)"
        # International Workers' Day
        name = "Празник рада"
        self[date(year, MAY, 1)] = name
        self[date(year, MAY, 2)] = name
        if self.observed and date(year, MAY, 1).weekday() in WEEKEND:
            self[date(year, MAY, 3)] = name + " (Observed)"
        # Armistice day
        name = "Дан примирја у Првом светском рату"
        self[date(year, NOV, 11)] = name
        if self.observed and date(year, NOV, 11).weekday() == SUN:
            self[date(year, NOV, 12)] = name + " (Observed)"
        # Easter
        self[easter(year, method=EASTER_ORTHODOX) - rd(days=2)] = \
            "Велики петак"
        self[easter(year, method=EASTER_ORTHODOX) - rd(days=1)] = \
            "Велика субота"
        self[easter(year, method=EASTER_ORTHODOX)] = "Васкрс"
        self[easter(year, method=EASTER_ORTHODOX) + rd(days=1)] = \
            "Други дан Васкрса" 
開發者ID:dr-prodigy,項目名稱:python-holidays,代碼行數:37,代碼來源:serbia.py

示例7: _populate

# 需要導入模塊: from dateutil import easter [as 別名]
# 或者: from dateutil.easter import EASTER_ORTHODOX [as 別名]
def _populate(self, year):
        if year < 1990:
            return

        # New Year's Day
        self[date(year, JAN, 1)] = "Нова година"

        # Liberation Day
        self[date(year, MAR, 3)] = \
            "Ден на Освобождението на България от османско иго"

        # International Workers' Day
        self[date(year, MAY, 1)] = \
            "Ден на труда и на международната работническа солидарност"

        # Saint George's Day
        self[date(year, MAY, 6)] = \
            "Гергьовден, Ден на храбростта и Българската армия"

        # Bulgarian Education and Culture and Slavonic Literature Day
        self[date(year, MAY, 24)] = \
            "Ден на българската просвета и култура и на славянската писменост"

        # Unification Day
        self[date(year, SEP, 6)] = "Ден на Съединението"

        # Independence Day
        self[date(year, SEP, 22)] = "Ден на Независимостта на България"

        # National Awakening Day
        self[date(year, NOV, 1)] = "Ден на народните будители"

        # Christmas
        self[date(year, DEC, 24)] = "Бъдни вечер"
        self[date(year, DEC, 25)] = "Рождество Христово"
        self[date(year, DEC, 26)] = "Рождество Христово"

        # Easter
        self[easter(year, method=EASTER_ORTHODOX) - rd(days=2)] = \
            "Велики петък"
        self[easter(year, method=EASTER_ORTHODOX) - rd(days=1)] = \
            "Велика събота"
        self[easter(year, method=EASTER_ORTHODOX)] = "Великден" 
開發者ID:dr-prodigy,項目名稱:python-holidays,代碼行數:45,代碼來源:bulgaria.py


注:本文中的dateutil.easter.EASTER_ORTHODOX屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。