Skip to content

Instantly share code, notes, and snippets.

@frayhan32
Last active December 23, 2015 02:39
Show Gist options
  • Save frayhan32/6568060 to your computer and use it in GitHub Desktop.
Save frayhan32/6568060 to your computer and use it in GitHub Desktop.
How Many Day This Month
//****************************************************************************//
//************************How many day this month*****************************//
//****************************************************************************//
//****************************************************************************//
//********************Result Also Depend On Your Time Setting System**********//
//****************************************************************************//
function dayThisMonth(year,month){
return new Date(year,month,0).getDate();
}
//****************************************************************************//
//************************************TEST HIM*******************************///
//****************************************************************************//
//When test add getMonth with 1 cause in Js month assumed from 0
alert(dayThisMonth(new Date().getFullYear(),new Date().getMonth()+1));
//Distributor Faris Rayhan
//May Be used to create calendar Object further
//regards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment