make sure getDaysInMonth doesn't fail if DST changes between months

This commit is contained in:
rolux 2014-08-16 09:07:42 +02:00
parent 4afdb71581
commit f01456e475

View file

@ -74,7 +74,8 @@ Ox.getDaysInMonth = function(year, month) {
: Ox.indexOf(Ox.MONTHS, function(v) {
return v.slice(0, 3) == month.slice(0, 3);
}) + 1;
return new Date(year, month, 0).getDate();
// Set to 1 AM since we may hit a DST change
return new Date(year, month, 0, 1).getDate();
}
/*@