get last date of a month javascript
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);var lastday = function(y,m){
return new Date(y, m +1, 0).getDate();
}
console.log(lastday(2014,0));
console.log(lastday(2014,1));
console.log(lastday(2014,11));
Also in JavaScript:
- prettier config vscode
- jquery click function
- jquery div hide show not working in wordpress
- get selected option value jquery
- push tr in tbody using jquery
- js get element type
- how to delete object property of array javascript
- cb() never called! npm ERR! This is an error with npm itself.
- rimraf node_modules
- css on keyboard enter click
- ngx-translate angular 11
- daysinmonth javascript
- get last date of a month javascript
- javascript open pdf in new tab
- Trouble setting up sample table. “Could not find matching row model for rowModelType clientSide”
- react router not working with aws amplify
- react import brackets
- console.log('qqqqqqqqqqqqqqqqqqqq'); jslint error how to fix
- square root javascript
- js different
- .fetch method
- js max value of array
- what is react native
- Uncaught Error: spawn node C:\Users\Leonl\Desktop\rpi-nano-server\electron\express\server.js ENOENT electron