i am trying to display the start date and current date of the current week in date picker using html and in chrome and firefox it is working well but in safari it is not displaying .Here is my code
<label>From Date</label>
<input type="date" id="dtp" required>
<label>To Date</label>
<input type="date" id="dtf" required>
these are my html date pickers and below is my script
function getMondayOfCurrentWeek(d){
var day = d.getDay();
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + (day == 0?-6:1)-day )
}
function Datep(){
document.getElementById("dtp").valueAsDate = new Date();
document.getElementById("dtf").valueAsDate = getMondayOfCurrentWeek(new Date());
}
so here page load i am inserting this function when ever the page loads it will display the current date and week start date. this is working in chrome and firefox but not working in safari..