diff options
| author | Loïc Guégan <loic.guegan@mailbox.org> | 2024-09-18 18:32:24 +0200 |
|---|---|---|
| committer | Loïc Guégan <loic.guegan@mailbox.org> | 2024-09-18 18:32:24 +0200 |
| commit | 76ddf4fe100d7023451eb3b3134de4a11a7ad852 (patch) | |
| tree | 5df054573ab4c7efc1c45bf1c977e37f94ff40fa /tropical/calstate.py | |
| parent | 171fbd28a33bd71a2b17b35c558c2029f4b72a0a (diff) | |
Minor changes
Diffstat (limited to 'tropical/calstate.py')
| -rw-r--r-- | tropical/calstate.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tropical/calstate.py b/tropical/calstate.py index 2a760a6..7bf285a 100644 --- a/tropical/calstate.py +++ b/tropical/calstate.py @@ -1,6 +1,6 @@ import calendar -from datetime import date, timedelta +from datetime import date, timedelta, datetime class CalState: @@ -20,6 +20,10 @@ class CalState: today = date.today() self.goto(today.year, today.month, today.day) + def today(self): + t=datetime.today() + return (t.year,t.month,t.day,int(t.strftime("%w"))-1) + def gotoNextWeek(self): day=date(self.year,self.month,self.day) + timedelta(weeks=1) self.goto(day.year,day.month, day.day) |
