Exemple #1
0
def getIndianCivilCalendarDateName( n ):
    if not isinstance( n, RPNDateTime ):
        raise ValueError( 'time type required for this operator' )

    date = indian_civil.from_gregorian( n.year, n.month, n.day )

    return indianCivilDays[ n.weekday( ) ] + ', ' + indianCivilMonths[ date[ 1 ] - 1 ] + \
           ' ' + str( date[ 2 ] ) + ', ' + str( date[ 0 ] )
Exemple #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)
Exemple #3
0
def getIndianCivilCalendarDateNameOperator( n ):
    date = indian_civil.from_gregorian( n.year, n.month, n.day )

    return indianCivilDays[ n.weekday( ) ] + ', ' + indianCivilMonths[ date[ 1 ] - 1 ] + \
           ' ' + str( date[ 2 ] ) + ', ' + str( date[ 0 ] )
Exemple #4
0
def getIndianCivilCalendarDateOperator( n ):
    return list( indian_civil.from_gregorian( n.year, n.month, n.day ) )
Exemple #5
0
def getIndianCivilCalendarDate( n ):
    if not isinstance( n, RPNDateTime ):
        raise ValueError( 'time type required for this operator' )

    return list( indian_civil.from_gregorian( n.year, n.month, n.day ) )
Exemple #6
0
 def to_indian_civil_date(self):
   from convertdate import indian_civil
   date_tuple = indian_civil.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])