JSFiddle - React, Tailwind, and code Playground
JavaScript
var curValDate = new Date('2012-03-03');
var tempDate = new Date();
var curDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate(), 23, 59, 59, 0);
alert( curDate );
var tempDate2 = new Date();
var curDate2 = new Date(tempDate2.getFullYear(), tempDate2.getMonth(), tempDate2.getDate(), 0, 0, 0, 0);
alert( curDate2 );