this is the function
//
function CompareDate(d1)
{
return ((new Date(d1))) > (new Date());
}
//
Vue.prototype.checkValidity = function(type){
let result
API.validity(function (res) {
if(res.code == 1){
if(type == "z"){
result = (CompareDate(res.data.zin_expiring))
console.log( "z",result)
return result
}
if(type == "s"){
result = (CompareDate(res.data.sync_expiring))
console.log( "s",result)
return result
}
} else {
console.log(res.msg);
}
},{
user_id: localStorage.getItem("user_id")
})
}
//
console.log( "",this.checkValidity("z"))
output result