current month start date and end date with formate in jquery
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));
<html>
<head>
<title>JavaScript Dates</title>
</head>
<body>
<script>
var date = new Date();
document.write("Current Date: " + date );
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
document.write("<br>"+firstDay);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
document.write("<br>"+lastDay);
</script>
</body>
</html>
Also in JavaScript:
- javascript fibonacci
- react dynamic settings
- document getelementsbyclassname not getting all elements
- using multiple http verbs on express path request
- "Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock once. You must buy before you can sell it"
- export default arrow function
- how to use react fragment
- insert value to html input with javascript variable
- How to send form data from react to express
- change the border of an image js
- receiving big response node js
- how to check if object exists in javascript
- javascript check if boolean is undefined
- calculator
- how to decode apollo client graphql error: bad request
- Generate random whole numbers javascript
- cannot get / angular
- how to change background color in javascript w3schools
- refresh div jquery
- javascript jquery get form field value
- validator.js github
- background-image url not working
- code to add to cart by javascript
- react route