Get First and Last day of Current Date in jQuery

Last Reply one year ago By pandeyism

Posted one year ago


I want to learn how to get first and last day of current month in datepicker

so the result should be 



its not working. first and last day not correct calculate

var bdate = new Date();
var edate = new Date();
bdate.setMonth(bdate.getMonth(), 1);
edate.setMonth(edate.getMonth() + 1, 0);

var firstDayofyear = bdate.toISOString().slice(0, 10);
var lastDayofyear = edate.toISOString().slice(0, 10);

$('#datepickerend').val(lastDayofyear );


This question does not have replies that have been liked.