Maybe you already fixed the "last day of month" problem in SVN, but I have a quick hack that works for me that you might be able to modify. It uses the "calendar" module in Python. Here's the patch:
Code:
--- default.py.orig 2010-10-06 00:57:42.032253626 -0400
+++ default.py 2010-10-06 00:51:38.149120919 -0400
@@ -441,8 +441,19 @@
elif self.args.period=="date":
#BUG CONNU : trouver un moyen de trouver le jour suivant en prenant en compte le nb de jours par mois
a,m,j=self.args.value.split("-")
- filelist = MPDB.search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,int(j)+1),format) )
+ #filelist = MPDB.search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,int(j)+1),format) )
+ import calendar
+ last_day_of_month = calendar.monthrange(int(a), int(m))[1]
+ end_day = int(j) + 1
+ # if we overshoot end of month, reset to that
+ if end_day > last_day_of_month:
+ end_day = last_day_of_month
+ filelist = MPDB.search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s 23:59:59"%(a,m,end_day),"%Y-%m-%d %H:%M:%S") )
+ else:
+ filelist = MPDB.search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,end_day),format) )
+
+
elif self.args.period=="period":
picfanart = os.path.join(PIC_PATH,"fanart-period.png")
filelist = MPDB.search_between_dates(DateStart=(urllib.unquote_plus(self.args.datestart),format),
--- resources/lib/MypicsDB.orig.py 2010-10-06 00:14:15.232460835 -0400
+++ resources/lib/MypicsDB.py 2010-10-06 00:49:24.711131509 -0400
@@ -858,7 +858,17 @@
elif period=="date":
#BUG CONNU : trouver un moyen de trouver le jour suivant en prenant en compte le nb de jours par mois
a,m,j=value.split("-")
- filelist = search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,int(j)+1),format) )
+ import calendar
+ last_day_of_month = calendar.monthrange(int(a), int(m))[1]
+ end_day = int(j) + 1
+ # if we overshoot end of month, reset to that
+ if end_day > last_day_of_month:
+ end_day = last_day_of_month
+ filelist = search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s 23:59:59"%(a,m,end_day),"%Y-%m-%d %H:%M:%S") )
+ else:
+ filelist = search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,end_day),format) )
+
+ #filelist = search_between_dates( ("%s-%s-%s"%(a,m,j),format) , ( "%s-%s-%s"%(a,m,int(j)+1),format) )
else:
#pas de periode, alors toutes les photos du 01/01 de la plus petite année, au 31/12 de la plus grande année