Index: django/views/generic/date_based.py
===================================================================
--- django/views/generic/date_based.py	(revision 1537)
+++ django/views/generic/date_based.py	(working copy)
@@ -108,14 +108,10 @@
     now = datetime.datetime.now()
     # Calculate first and last day of month, for use in a date-range lookup.
     first_day = date.replace(day=1)
-    last_day = date
-    for i in (31, 30, 29, 28):
-        try:
-            last_day = last_day.replace(day=i)
-        except ValueError:
-            continue
-        else:
-            break
+    try:
+        last_day = first_day.replace(month=(first_day.month+1)%12)
+    except ValueError:
+        last_day = first_day.replace(month=(first_day.month+1))
     lookup_kwargs = {'%s__range' % date_field: (first_day, last_day)}
     # Only bother to check current date if the month isn't in the past.
     if last_day >= now.date():
