Compare commits
No commits in common. "snoopy-dev" and "master" have entirely different histories.
snoopy-dev
...
master
@ -38,7 +38,7 @@ def get_locale():
|
|||||||
Selects the best locale based on values sent by the browser.
|
Selects the best locale based on values sent by the browser.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
supported_languages = ['en', 'hu', 'pl']
|
supported_languages = ['en', 'hu']
|
||||||
|
|
||||||
if 'l' in request.args and request.args['l'].lower() in supported_languages:
|
if 'l' in request.args and request.args['l'].lower() in supported_languages:
|
||||||
return request.args['l'].lower()
|
return request.args['l'].lower()
|
||||||
|
@ -105,13 +105,6 @@ class GregorianCalendar(CalendarSystem):
|
|||||||
|
|
||||||
return self.timestamp.replace(year=self.timestamp.year - 1).year
|
return self.timestamp.replace(year=self.timestamp.year - 1).year
|
||||||
|
|
||||||
@property
|
|
||||||
def current_month_first(self):
|
|
||||||
"""Return the timestamp for the first day of the current month
|
|
||||||
"""
|
|
||||||
|
|
||||||
return self.timestamp.replace(day=1)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prev_month(self):
|
def prev_month(self):
|
||||||
"""Returns the timestamp of the same day in the previous month
|
"""Returns the timestamp of the same day in the previous month
|
||||||
@ -120,14 +113,19 @@ class GregorianCalendar(CalendarSystem):
|
|||||||
if self.timestamp.month == 1:
|
if self.timestamp.month == 1:
|
||||||
return self.prev_year.replace(month=12)
|
return self.prev_year.replace(month=12)
|
||||||
|
|
||||||
return self.current_month_first - timedelta(days=1)
|
return self.timestamp.replace(month=self.timestamp.month - 1)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def prev_month_name(self):
|
def prev_month_name(self):
|
||||||
"""The name of the previous month
|
"""The name of the previous month
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return self.month_names[self.prev_month.month]
|
if self.timestamp.month == 1:
|
||||||
|
timestamp = self.prev_year.replace(month=12)
|
||||||
|
else:
|
||||||
|
timestamp = self.timestamp.replace(month=self.timestamp.month - 1)
|
||||||
|
|
||||||
|
return self.month_names[timestamp.month - 1]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def next_month(self):
|
def next_month(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user