myDebug.line=1;try{ var script_date='js:date',date_stop=1; alert("ljs:4 - "+script_date); jsscriptslist=jsscriptslist.concat(new Array(script_date)); myDebug.checkjsload(script_date); ///tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'load: '+script_date,kjsstop:date_stop}; tagfct.kjsfct='load: '+script_date; tagfct.kjsfile=script_date;tagfct.kjsline=myDebug.line;tagfct.kjsstop=date_stop; ///}catch(e){if(myDebug)myDebug.debug_view_e_catch(e,tagfct);} function get_date_with_format(format){ myDebug.line=11;try{ ///tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'get_date_with_format(format)',kjsstop:date_stop}; tagfct.kjsfct='get_date_with_format(format)'; tagfct.kjsfile=script_date;tagfct.kjsline=myDebug.line;tagfct.kjsstop=date_stop; ////var tagfct = {'file':script_date,'fct':'get_date_with_format(format)'},stop=date_stop; var Digital=new Date(); var field=new Array(Digital.getFullYear(),Digital.getMonth()+1,Digital.getDate(), Digital.getHours(),Digital.getMinutes(),Digital.getSeconds(),Digital.getMilliseconds()); var formatYmdHis='',step=9; for(i=0;i0) msg=msg+myDebug.chrrc+' * Invalid day'; test=(monthvalue-12); if(test>0) msg=msg+myDebug.chrrc+' * Invalid month'; if(actu.getMonth()+1>=monthvalue){ if(actu.getMonth()+1==monthvalue){ if(actu.getDate()>=dayvalue){ months=actu.getMonth()+1-monthvalue; years=actu.getFullYear()-yearvalue; }else { months=(12-monthvalue)+actu.getMonth()+1; years=actu.getFullYear()-yearvalue-1; } }else {months=actu.getMonth()+1-monthvalue; years=actu.getFullYear()-yearvalue; } }else { months=(12-monthvalue)+actu.getMonth()+1; years=actu.getFullYear()-yearvalue-1; } if(actu.getDate()>dayvalue) days=actu.getDate()-dayvalue; else days=(30-dayvalue)+actu.getDate(); while(days>30){ days-=30; months+=1; } while(months>12){ months-=12; years+=1; } return(years+';'+msg); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function bissextile(annee){ myDebug.line=80;try{ //tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'bissextile(annee)',kjsstop:date_stop}; tagfct.kjsfct='bissextile(annee)'; tagfct.kjsfile=script_date;tagfct.kjsline=myDebug.line;tagfct.kjsstop=date_stop; ///try{myDebug.line=90; ///var tagfct = {'file':script_date,'fct':'bissextile(annee)'},stop=date_stop; if(annee%4==0&&annee%100!=0||annee%400==0) return(true); else return(false); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function nb_01_01(date){ myDebug.line=92;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'nb_01_01(date)',kjsstop:date_stop}; ///myDebug.line=97;try{ ///var tagfct = {'file':script_date,'fct':'nb_01_01(date)'},stop=date_stop; var nb_months=[,0,31,59,90,120,151,181,212,243,273,304,334]; var j=eval(date[0]); var m=eval(date[1]); var a=eval(date[2]); var nb=nb_months[m]+j-1;if(bissextile(a)&&m>2)nb++; return(nb); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function fCompareDate(pDateDebut,pDateFin){ myDebug.line=106;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'fCompareDate(pDateDebut,pDateFin)',kjsstop:date_stop}; ///myDebug.line=110;try{ ///var tagfct = {'file':script_date,'fct':'fCompareDate(pDateDebut,pDateFin)'},stop=date_stop; var DureeDebut=Date.parse(pDateDebut); var DureeFin=Date.parse(pDateFin); var iComparaison=DureeFin-DureeDebut; if(iComparaison>0) return(">"); if(iComparaison==0)return("="); if(iComparaison<0)return("<"); return(iComparaison); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function nb_jour_annee(a1,a2){ myDebug.line=122;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'nb_jour_annee(a1,a2)',kjsstop:date_stop}; ////myDebug.line=125;try{ ////var tagfct = {'file':script_date,'fct':'nb_jour_annee(a1,a2)'},stop=date_stop;* var n=0; if(a1==a2) n=0; else for(i=a1;i=monthvalue){ if((actu.getMonth()+1)==monthvalue){ if(actu.getDate()>=dayvalue){ months=actu.getMonth()+1-monthvalue;years=actu.getFullYear()-yearvalue; }else { months=(12-monthvalue)+actu.getMonth()+1; years=actu.getFullYear()-yearvalue-1; } }else { months=(actu.getMonth()+1)-monthvalue; years=actu.getFullYear()-yearvalue; } }else { months=(12-monthvalue)+actu.getMonth()+1; years=actu.getFullYear()-yearvalue-1; } if(actu.getDate()>dayvalue) days=actu.getDate()-dayvalue;else days=(30-dayvalue)+actu.getDate(); while(days>30){days-=30;months+=1;} while(months>12){months-=12;years+=1;} return(new Array(years,months,days)); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } myApp.checkDate=function(_date){ myDebug.line=224;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'myApp.checkDate=function(_date)',kjsstop:date_stop}; /////myDebug.line=221;try{ /////var tagfct = {'file':script_date,'fct':'myApp.checkDate=function(_date)'},stop=date_stop; var reg=new RegExp(/^[0-3]{1}[0-9]{1}[\/][0-1]{1}[0-9]{1}[\/][0-9]{4}$/); if(!reg.test(_date)){return(false);} var tabDate=_date.split('/'); var dateTest=new Date(tabDate[2],tabDate[1]-1,tabDate[0]); if(parseInt(tabDate[0],10)!=parseInt(dateTest.getDate(),10)||parseInt(tabDate[1],10)!=parseInt(dateTest.getMonth(),10)+parseInt(1,10)||parseInt(tabDate[2],10)!=parseInt(dateTest.getFullYear(),10)) {return(false);} return(true); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } myApp.get_age_from_date=function(_date){ myDebug.line=238;try{ var tagfct = {'file':script_date,'fct':'myApp.get_age_from_date=function(_date)'},stop=date_stop; if(!myApp.checkDate(_date)) return(''); var days=''; var msg=new Array(); msg['msg']=''; var actu=new Date(); var months=actu.getMonth(); var yearvalue=actu.getFullYear(); var tab=new Array(31,28,31,30,31,30,31,31,30,31,30,31); if((yearvalue%4==0&&yearvalue%100!=0)||(yearvalue%400==0)) tab[1]+=1; msg['nbrD']='31'; tab=_date.split('/'); var dayvalue=(tab[0]?tab[0]:false); var monthvalue=(tab[1]?tab[1]:false); yearvalue=(tab[2]?tab[2]:false); if(!dayvalue||!monthvalue||!yearvalue) return(msg['msg']); if((dayvalue-31)>0) msg['msg']+=myDebug.chrrc+' * Invalid day'; if((monthvalue-12)>0) msg['msg']+=myDebug.chrrc+' * Invalid month'; if(actu.getMonth()+1>=monthvalue){ if(actu.getMonth()+1==monthvalue){ if(actu.getDate()>=dayvalue){ months=actu.getMonth()+1-monthvalue;msg['age']=actu.getFullYear()-yearvalue; }else { months=(12-monthvalue)+actu.getMonth()+1; msg['age']=actu.getFullYear()-yearvalue-1; }}else { months=actu.getMonth()+1-monthvalue; msg['age']=actu.getFullYear()-yearvalue; } }else { months=(12-monthvalue)+actu.getMonth()+1; msg['age']=actu.getFullYear()-yearvalue-1; }; if(actu.getDate()>dayvalue) days=actu.getDate()-dayvalue; else days=(30-dayvalue)+actu.getDate(); while(days>30){days-=30;months+=1;} while(months>12){months-=12;msg['age']+=1;} return(msg); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function get_formatted_date(format){ myDebug.line=289;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'get_formatted_date(format)',kjsstop:date_stop}; ////myDebug.line=299;try{ ////var tagfct = {'file':script_date,'fct':'get_formatted_date(format)'},stop=date_stop; var d=new Date(); var year=d.getFullYear(); var month=d.getMonth()+1; if(month.toString().length==1) month='0'+month; var day=d.getDate(); if(day.toString().length==1) day='0'+day; var date=year.toString()+'-'+month.toString()+'-'+day.toString(); var hours=d.getHours(); if(hours.toString().length==1) hours='0'+hours; var minutes=d.getMinutes(); if(minutes.toString().length==1) minutes='0'+minutes; var seconds=d.getSeconds(); if(seconds.toString().length==1) seconds='0'+seconds; var hour=hours.toString()+':'+minutes.toString()+':'+seconds.toString(); if(format){ switch(format){ case'date+hour':return(date+' '+hour); case'hour':return(hour); } } return(new Array(date+hour,date,hour,year,month,day,hours,minutes,seconds)); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function actualize_hour_slave0(actuallabel,pass,div,count,howmany,stop){ myDebug.line=323;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'actualize_hour_slave0(actuallabel,pass,div,count,howmany,stop)',kjsstop:date_stop}; ////myDebug.line=322;try{ ///var tagfct = {'file':script_date,'fct':'actualize_hour_slave0(actuallabel,pass,div,count,howmany,stop)'},stop=date_stop; var x=myDebug.GetId(actuallabel),o,c,y,i; if(!pass&&x){ o=myDebug.GetId(div); c=myDebug.GetId(count); stop=(stop?true:false); if((parseInt(x.value)>howmany&&o&&c)||stop){ y=c.value.split('-'); if(y.length==3&&parseInt(y[2])==0) return(pass); y[2]=(y[2]?(stop?0:y[2]):1); z=parseInt(y[0]); i=(z<=y[1]?z+1:0); c.value=i+'-'+y[1]+'-'+y[2]; if(y[2]){ myApp.istabshow=true; o.tabber.tabShow(i); } x.value=-1; pass=true; } x.value=parseInt(x.value)+1; } return(pass); }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } function actualize_hour(){ myDebug.line=354;try{ tagfct = {kjsfile:script_date,kjsline:myDebug.line,kjsfct:'actualize_hour()',kjsstop:date_stop}; ////myDebug.line=362;try{ ////var tagfct = {'file':script_date,'fct':'actualize_hour()'},stop=date_stop; var x=myDebug.GetId('actualhour_label'); if(x){ var xdate=get_formatted_date(),pass=false; myDebug.line=369; x.innerHTML=xdate[2]; myDebug.line=371; var d=get_formatted_date(); if(!myApp.callajaxrunning){ if(d[8]%2) pass=actualize_hour_slave0('hactualhour_label',pass,'0.oneposts.0','count_oneposts',10); if(d[8]%3) pass=actualize_hour_slave0('hactualvideo_label',pass,'1.rpanel.0','count_rpanelvideos',15);}}; }catch(e){if($.isFunction(window.dbgvec))debug_view_e_catch(e,tagfct);} } }catch(e){if(myDebug)myDebug.debug_view_e_catch(e,tagfct);}