JSFiddle - React, Tailwind, and code Playground
by fdezluis96
JavaScript
function _r_c(name){_cookie=name+'=';_cookies=document.cookie.split(';');for(var i=0;i<_cookies.length;i++){thisCookie=_cookies[i];while(thisCookie.charAt(0)==' '){thisCookie=thisCookie.substring(1,thisCookie.length);}
if(thisCookie.indexOf(_cookie)==0){return thisCookie.substring(_cookie.length,thisCookie.length);}}
return null;}
function _s_c(name,value,days){var expireDate=new Date();expireDate.setDate(expireDate.getDate()+ days);document.cookie=name+"="+ escape(value)+"; expires="+ expireDate.toUTCString()+"; path=/";}
var d = new Date("06/25/12");
alert(d);
var today = new Date();
var month = today.getMonth() + 1;
var day = today.getDate();
var year = today.getYear();
today = month + '/' + day + '/'+ year;
_s_c('actual', '07/23/12', 30);
alert(d > today);