Feedback on:irt.org FAQ Knowledge Base Q533
Comments:Here is an example on how to use the script
<form><script>function days_in_month (year, month) { return 32 - new Date(year, month, 32).getDate();}now = new Date();daysInMonth = days_in_month(now.getFullYear(),now.getMonth());txt='<select name="days">';for (i=1;i<=daysInMonth;i++) txt += 'txt+='</select>';document.write(txt)</script></form> Sent by Jeff Boulton on September 05, 2001 at 10:41:18: - feedback #3128 Worth: Very worth reading Comments:Very cool. But unless I am missing something the day number is zero based. ie: February is "1"THANX Sent by W on September 29, 2002 at 20:07:38: - feedback #4177 Worth: Not worth reading Length: Too short Comments:Hey!What value does newdate have?! Are the variables being multiplied by newdate then added together or are they being manipulated on some other way?! What language is this written in?! What is the point in posting this without any type of explanation. Does the individual who posted this think everyone has the same knowledge as they? Or is it if they don't already know then they have no business looking here anyway?! If this is a fair sample of your database I propose that it must be a usless waste of storage space!!!!!!!! Sent by Pankaj Jain on November 13, 2002 at 14:28:25: - feedback #4265 Technical: Not technical enough Comments:It is a clever peice of code, but it looks like it is using a so called BUG in the Date() object. Ideally if you pass day as 32 it should give you error. Think when this bug is fixed and your program will stop working; you will have tough time finding this error. Sent by Giacomo on Tuesday July 10, 2007 at 00:12:03 - feedback #4793 Worth:Very worth reading Length:Just right Technical:Just right Comments:Why not try var date = new Date();date.setMonth(2,0);var numberOfDaysInJanuary = date.getDate(); What's New How to do the impossible with Google Gears Out and About -- div -->
Worth: Very worth reading
Comments:Very cool. But unless I am missing something the day number is zero based. ie: February is "1"
THANX
Worth: Not worth reading
Length: Too short
Comments:Hey!What value does newdate have?! Are the variables being multiplied by newdate then added together or are they being manipulated on some other way?! What language is this written in?! What is the point in posting this without any type of explanation. Does the individual who posted this think everyone has the same knowledge as they? Or is it if they don't already know then they have no business looking here anyway?! If this is a fair sample of your database I propose that it must be a usless waste of storage space!!!!!!!!
Technical: Not technical enough
Comments:It is a clever peice of code, but it looks like it is using a so called BUG in the Date() object. Ideally if you pass day as 32 it should give you error. Think when this bug is fixed and your program will stop working; you will have tough time finding this error.
Worth:Very worth reading
Length:Just right
Technical:Just right
Comments:Why not try var date = new Date();date.setMonth(2,0);var numberOfDaysInJanuary = date.getDate();
How to do the impossible with Google Gears
Out and About