// intl_use.js // Help out cmyk_rgb.html // Send email with an internationalized date via intl_use.html var options = {year: "2-digit", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", timeZoneName: "short"}; var localdatetime = new Intl.DateTimeFormat("en-US",options).format; var lcode="en-US"; var prezhr=null; var prezform=null; var aconto=null, acontobih=''; function glt(iois) { var fabih=''; if (!aconto) { if (iois != null) { aconto = (iois.contentWindow || iois.contentDocument); if (aconto != null) { if (aconto.document) { aconto = aconto.document; } acontobih=aconto.body.innerHTML; fabih=acontobih; if (acontobih.trim().indexOf('var option') == 0) { eval(acontobih.split('var ')[1].split('<')[0]); } else { fabih=''; } if (acontobih.trim().indexOf('') != -1) { eval("lcode='" + acontobih.split('')[1].split('<')[0] + "';"); } else { fabih=''; } acontobih=fabih; } } } } function ifitnow() { var inputv=[], inputsv=document.getElementsByTagName('input'), iiv=0; if (document.getElementById('ifintl') && document.getElementById('intldiv')) { iiv=iiv; } else { for (iiv=0; iiv') != -1) { //alert(111); console.log('prelcode'); lcode=document.getElementById('intldiv').innerHTML.split('')[eval(-1 + document.getElementById('intldiv').innerHTML.split('').length)].split('')[0]; //alert(1111); if (document.getElementById('intldiv').innerHTML.replace(/\ options\ \=\ /g,'options=').replace(/\ options\ \=/g,'options=').replace(/\ options\=\ /g,'options=').indexOf('options=') != -1) { console.log('options=' + document.getElementById('intldiv').innerHTML.replace(/\ options\ \=\ /g,'options=').replace(/\ options\ \=/g,'options=').replace(/\ options\=\ /g,'options=').split('options=')[eval(-1 + document.getElementById('intldiv').innerHTML.replace(/\ options\ \=\ /g,'options=').replace(/\ options\ \=/g,'options=').replace(/\ options\=\ /g,'options=').split('options=').length)].split(';')[0].replace('timeZZoneName: "short"', 'timeZoneName: "long"').replace('timeZZoneName:"short"', 'timeZoneName:"long"')); eval('options=' + document.getElementById('intldiv').innerHTML.replace(/\ options\ \=\ /g,'options=').replace(/\ options\ \=/g,'options=').replace(/\ options\=\ /g,'options=').split('options=')[eval(-1 + document.getElementById('intldiv').innerHTML.replace(/\ options\ \=\ /g,'options=').replace(/\ options\ \=/g,'options=').replace(/\ options\=\ /g,'options=').split('options=').length)].split(';')[0].replace('timeZZoneName: "short"', 'timeZoneName: "long"').replace('timeZZoneName:"short"', 'timeZoneName:"long"') + ';'); console.log('pretzs'); tzs=' (' + document.getElementById('intldiv').innerHTML.split('timeZone:')[eval(-1 + document.getElementById('intldiv').innerHTML.split('timeZone:').length)].split('"')[1].split('"')[0] + ')'; //alert(tzs); console.log(tzs); } } //eval(document.getElementById('intldiv').innerHTML); d = new Date(); timedatenow = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); localdatetime = new Intl.DateTimeFormat(lcode, options).format; zform.append('inline', localdatetime(timedatenow) + tzs.replace(' (UTC)','')); } else if (acontobih != '') { //alert(lcode); //console.log(options); d = new Date(); //timedatenow = new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()); timedatenow = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); localdatetime = new Intl.DateTimeFormat(lcode, options).format; //alert(localdatetime(timedatenow)); zform.append('inline', localdatetime(timedatenow)); } else if (aconto) { zform.append('inline', mydate.toLocaleString()); } else { zform.append('inline', mydate.toLocaleString()); } //alert(mydate.toLocaleString()); zform.append('to', document.getElementById('to').value); if (feedback != '') { zform.append('subj', document.getElementById('subj').value + ' ... ' + feedback + ' ... '); } else if (document.getElementById('feedback').value != '') { zform.append('subj', document.getElementById('subj').value + ' ... ' + document.getElementById('feedback').value + ' ... '); } else { zform.append('subj', document.getElementById('subj').value); } zform.append('htmlis', document.getElementById('htmlis').value); zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true); //zhr.onreadystatechange = ajaxDateIt; zhr.send(zform); if (document.getElementById('emailb')) { document.getElementById('emailb').style.backgroundColor='lightgreen'; } } } } } function ajaxMailOff() { prezhr = new XMLHttpRequest(); prezhr.open('get', '//www.rjmprogramming.com.au/HTMLCSS/intl_use.html', true); prezhr.onreadystatechange = ajaxDateIt; prezhr.send(null); } setTimeout(ifitnow, 1000);