query: fix bug with computation of date query: periods including the first days of the current months were calculated wrongly

This commit is contained in:
Jean-Francois Dockes
2013-11-07 18:13:11 +01:00
parent fab98b8bd4
commit 9b172b731c
3 changed files with 14 additions and 11 deletions
+1
View File
@@ -883,6 +883,7 @@ static bool addperiod(DateInterval *dp, DateInterval *pp)
int monthdays(int mon, int year)
{
switch (mon) {
// We are returning a few two many 29 days februaries, no problem
case 2: return (year % 4) == 0 ? 29 : 28;
case 1:case 3:case 5:case 7: case 8:case 10:case 12: return 31;
default: return 30;