diff --git a/dmapp/dmweb/__init__.pyc b/dmapp/dmweb/__init__.pyc new file mode 100644 index 0000000..ed385b7 Binary files /dev/null and b/dmapp/dmweb/__init__.pyc differ diff --git a/dmapp/dmweb/dmcal.py b/dmapp/dmweb/dmcal.py index 0de9875..866af14 100644 --- a/dmapp/dmweb/dmcal.py +++ b/dmapp/dmweb/dmcal.py @@ -1,4 +1,4 @@ -import datetime +from datetime import datetime from pprint import pprint from flask import Blueprint, render_template import pytz @@ -21,13 +21,17 @@ class DMHTMLCalendar(calendar.HTMLCalendar): def setcalmonth(self, month): self.dmmonth = month + def setcalyear(self, year): + self.dmyear = year + def oneday(self,month,day): - start = datetime.datetime(2020, month, day).replace(hour=0, + current_year = datetime.today().year + start = datetime(self.dmyear, month, day).replace(hour=0, minute=0, second=0) - end = datetime.datetime(2020, month, day).replace (hour=23, + end = datetime(self.dmyear, month, day).replace (hour=23, minute=59, second=59) @@ -63,11 +67,11 @@ class DMHTMLCalendar(calendar.HTMLCalendar): break - start = datetime.datetime(2020, month, start_day).replace(hour=0, + start = datetime(self.dmyear, month, start_day).replace(hour=0, minute=0, second=0) - end = datetime.datetime(2020, month, end_day).replace (hour=23, + end = datetime(self.dmyear, month, end_day).replace (hour=23, minute=59, second=59) @@ -82,18 +86,6 @@ class DMHTMLCalendar(calendar.HTMLCalendar): return returnstr - # def formatmonthname(self, theyear, themonth, withyear=True): - # """ - # Return a month name as a table row. - # """ - # if withyear: - # s = '%s %s' % (month_name[themonth], theyear) - # else: - # s = '%s' % month_name[themonth] - # return '