MCPcopy
hub / github.com/django/django / _get_next_month

Method _get_next_month

django/views/generic/dates.py:105–117  ·  view source on GitHub ↗

Return the start date of the next interval. The interval is defined by start date <= item date < next start date.

(self, date)

Source from the content-addressed store, hash-verified

103 return _get_next_prev(self, date, is_previous=True, period="month")
104
105 def _get_next_month(self, date):
106 """
107 Return the start date of the next interval.
108
109 The interval is defined by start date <= item date < next start date.
110 """
111 if date.month == 12:
112 try:
113 return date.replace(year=date.year + 1, month=1, day=1)
114 except ValueError:
115 raise Http404(_("Date out of range"))
116 else:
117 return date.replace(month=date.month + 1, day=1)
118
119 def _get_current_month(self, date):
120 """Return the start date of the previous interval."""

Callers 1

get_dated_itemsMethod · 0.80

Calls 1

Http404Class · 0.90

Tested by

no test coverage detected