Added convienience method for getting year in the calendar of a date
svn: r13731
This commit is contained in:
parent
9fd2e4a7fc
commit
4434fd6542
@ -1231,6 +1231,16 @@ class Date(object):
|
||||
"""
|
||||
return self._get_low_item(Date._POS_YR)
|
||||
|
||||
def get_year_calendar(self, calendar=None):
|
||||
"""
|
||||
Return the year of this date in the calendar given.
|
||||
|
||||
Defaults to self.calendar if one is not given.
|
||||
"""
|
||||
if not calendar:
|
||||
calendar = self.calendar
|
||||
return self.to_calendar(calendar).get_year()
|
||||
|
||||
def get_new_year(self):
|
||||
"""
|
||||
Return the new year code associated with the date.
|
||||
|
Loading…
Reference in New Issue
Block a user