Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Pickadate.js. Parent comment
getCountDays( 2012, 2 ) // Daylight time began March 11 30 // oops
A quick and dirty fix would be to use Math.round instead of Math.floor:
getCountDays = function( year, month ) { var msInMonth = new Date(year,month+1) - new Date(year,month); return Math.round( msInMonth / MILLISECONDS_IN_DAY ); },
getCountDays = function( year, month ) { var msInMonth = Date.UTC(year,month+1) - Date.UTC(year,month); return Math.round( msInMonth / MILLISECONDS_IN_DAY ); },
There are no comments on this comment yet.
A quick and dirty fix would be to use Math.round instead of Math.floor:
And maybe better to use UTC? (I'd stick with Math.round at the same time.)