Ejemplo n.º 1
0
    def testNonChalcedonian(self):
        # In these years, Orthodox Easter falls on 6 April (Julian),
        # but Non-Chalcedonian churches celebrate it a week later on 13 Aprail
        years = (
            570,
            665,
            760,
            1007,
            1102,
            1197,
            1292,
            1539,
            1634,
            1729,
            1824,
            2071,
            2166,
            2261,
            2356,
        )

        for y in years:
            orthodox = julian.from_gregorian(*holidays.easter(y, "orthodox"))
            eastern = julian.from_gregorian(*holidays.easter(y, "eastern"))
            self.assertNotEqual(orthodox, eastern)
            self.assertEqual((y, 4, 6), orthodox)
            self.assertEqual((y, 4, 13), eastern)

        for y in years:
            self.assertEqual(holidays.easter(y + 1, "orthodox"),
                             holidays.easter(y + 1, "eastern"))
Ejemplo n.º 2
0
 def test_returntype(self):
     self.assertSequenceType(coptic.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(hebrew.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(islamic.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(indian_civil.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(iso.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(julian.from_gregorian(2020, 6, 4), int)
     self.assertSequenceType(persian.from_gregorian(2020, 6, 4), int)
Ejemplo n.º 3
0
def getJulianCalendarDateOperator( n ):
    return list( julian.from_gregorian( n.year, n.month, n.day ) )
Ejemplo n.º 4
0
def getJulianCalendarDate( n ):
    if not isinstance( n, RPNDateTime ):
        raise ValueError( 'time type required for this operator' )

    return list( julian.from_gregorian( n.year, n.month, n.day ) )
Ejemplo n.º 5
0
 def to_juluan_date(self):
   from convertdate import julian
   date_tuple = julian.from_gregorian(year=self.year, month=self.month, day=self.day)
   return Date(year=date_tuple[0], month=date_tuple[1], day=date_tuple[2])