mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #27 from moin18/master
'week' and 'weekday' as properties to 'MayaDT' object
This commit is contained in:
@@ -140,6 +140,15 @@ class MayaDT(object):
|
||||
def day(self):
|
||||
return self.datetime().day
|
||||
|
||||
@property
|
||||
def week(self):
|
||||
return self.datetime().isocalendar()[1]
|
||||
|
||||
@property
|
||||
def weekday(self):
|
||||
"""Return the day of the week as an integer. Monday is 1 and Sunday is 7"""
|
||||
return self.datetime().isoweekday()
|
||||
|
||||
@property
|
||||
def hour(self):
|
||||
return self.datetime().hour
|
||||
|
||||
Reference in New Issue
Block a user