javascript get current month start and end date
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
javascript get current month start and end date
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
month javascript get data range
$(function(){
var formatted_date = function(date){
var m = ("0"+ (date.getMonth()+1)).slice(-2); // in javascript month start from 0.
var d = ("0"+ date.getDate()).slice(-2); // add leading zero
var y = date.getFullYear();
return m +'-'+d+'-'+y;
}
var curr_date =new Date();
var first_day = new Date(curr_date.getFullYear(), curr_date.getMonth(), 1);
var last_day = new Date(curr_date.getFullYear(), curr_date.getMonth() + 1, 0);
var month_start_date =formatted_date(first_day);
var month_end_date =formatted_date(last_day);
date=month_start_date + ' To '+month_end_date; // date range for current month
/*
var month_end_date =formatted_date(new Date()); // limit current month date range upto current day.
*/
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us