$(document).ready(function(){ let searchParams = new URLSearchParams(window.location.search); const days =30;//Number of days for expiry var curdate = new Date(); if(localStorage.getItem("pid_details")){ let pid_details = localStorage.getItem("pid_details"); let pid_json = JSON.parse(pid_details); let validpid = []; jQuery(pid_json).each(function (index){ var expdate = new Date(pid_json[index].expiry); if(curdate 0) { let ele = ``; $("#idUrlSubmitForm").append(ele); } } } })