Location: JavaScript
JavaScript function for getting the last day in month
Sometimes you need to know the last day in month of a given month.
This is a nice JavaScript Solution to this case.
This is a nice JavaScript Solution to this case.
function getDaysInMonth(aDate){
// returns the last day of a given month
var m = new Number(aDate.getMonth());
var y = new Number(aDate.getYear());
var tmpDate = new Date(y, m, 28);
var checkMonth = tmpDate.getMonth();
var lastDay = 27;
while(lastDay <= 31){
temp = tmpDate.setDate(lastDay + 1);
if(checkMonth != tmpDate.getMonth())
break;
lastDay++
}
return lastDay;
}
Rate:
Be the first to Rank
Be the first to RankSurfers Feedbacks
01. Thanks! that is exactly what i was looking for... / nick (08/03/2010)
Related content
|
06/02/2011
Rate:
Be the first to RankCodeMirror is a JavaScript library that can be used to create a relatively pleasant editor interface.. |
|
|
very simple solution for a big problem 01/12/2010
Rate:
Be the first to Rankproblem with loading JavaScript in the HEAD tag is that scripts load before HTML, makes the site load.. Location: JavaScript / PHP
|
|
27/03/2010
Rate:
Be the first to RankIt’s time for more JavaScript and jQuery goodies here on Noupe. Today we are featuring fresh JavaScript.. Location: JavaScript / jQuery
|
||
|
26/12/2010
Rate:
Be the first to RankFor the past year and a half, we've been pouring our heart into JavaScriptMVC 3.0. So it's with.. |
|











