Changeset 3512


Ignore:
Timestamp:
11/17/10 13:17:16 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1322 - Data incorreta nas mensagens na caixa de entrada (local antigas).

Location:
branches/2.2/expressoMail1_2/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/js/draw_api.js

    r3499 r3512  
    840840                if (typeof offsetToGMT == 'undefined') 
    841841                { 
    842                     offsetToGMT = headers_msgs.offsetToGMT; 
     842                    // In older local messages headers_msgs.offsetToGMT is undefined. 
     843                    offsetToGMT = typeof headers_msgs.offsetToGMT != 'undefined'?headers_msgs.offsetToGMT:0; 
    843844                } 
    844845                var tr_element = document.createElement('tr'); 
     
    10601061                today.setMinutes(0); 
    10611062 
    1062                  // Using offset between user defined timezone and GMT 
    1063                  // Date object converts time to local timezone, so we have to adjust it 
    1064                 var udate_local = headers_msgs.udate*1000 + offsetToGMT*1000 + today.getTimezoneOffset()*60*1000; 
    1065                 var date_msg = new Date(udate_local); 
     1063                var udate_local = null; 
     1064                var date_msg = null; 
     1065 
     1066                // old local messages can capture headers_msgs.udate as "hh:mm" or "dd/mm/yyyy" 
     1067                if (headers_msgs.udate.toString().match(/\d{2}:\d{2}/) || headers_msgs.udate.toString().match(/\d{2}\/\d{2}\/\d{4}/)) 
     1068                { 
     1069                    temp_msg_day = headers_msgs.msg_day.split('/'); 
     1070                    temp_msg_hour = headers_msgs.msg_hour.split(':'); 
     1071                    date_msg = new Date(temp_msg_day[2], temp_msg_day[1]-1, temp_msg_day[0], temp_msg_hour[0], temp_msg_hour[1]); 
     1072                } 
     1073                else 
     1074                    { 
     1075                        // The new date implementation 
     1076                        // Using offset between user defined timezone and GMT 
     1077                        // Date object converts time to local timezone, so we have to adjust it 
     1078                        udate_local = headers_msgs.udate*1000 + offsetToGMT*1000 + today.getTimezoneOffset()*60*1000; 
     1079                        date_msg = new Date(udate_local); 
     1080                    } 
    10661081 
    10671082                if (today.getTime() - date_msg.getTime() < 86400000) 
  • branches/2.2/expressoMail1_2/js/local_messages.js

    r3502 r3512  
    459459                 
    460460        sql = 'select mail.rowid as rowid,mail.header as header,mail.size as size,' + 
    461     'mail.timestamp as timestamp,mail.unseen as unseen,mail.body as body,' + 
     461    'mail.timestamp as timestamp,mail.unseen as unseen,mail.body as body, mail.mail as mail, ' + 
    462462    'case when lower(mail.ffrom) like ? then ' + 
    463463    'case when ltrim(ltrim(substr(UPPER(fto),7,length(fto)),\':\'),\'"\') like \'5:%\' then ' + 
     
    501501        var head = rs.field(1); 
    502502        var codigoMail = rs.field(0); 
     503        var mail = rs.field(6); 
    503504 
    504505        var msg_body = rs.field(5);//recebe o conteudo da coluna "body" do banco de dados; 
     
    506507        var rs2 = this.dbGears.execute('select count(*) from anexo where id_mail = '+codigoMail); 
    507508        var head_unserialized = connector.unserialize(head); 
    508         head_unserialized.Size = rs.field(2); 
     509        var mail_unserialized = connector.unserialize(mail); 
     510 
     511      head_unserialized.Size = rs.field(2); 
    509512        if(rs.field(4)==1) 
    510513            head_unserialized.Unseen = 'U'; 
     
    516519        retorno[cont] = head_unserialized; 
    517520        retorno[cont]['msg_number'] = codigoMail; 
    518                          
     521        retorno[cont]['msg_day'] = mail_unserialized.msg_day; 
     522        retorno[cont]['msg_hour'] = mail_unserialized.msg_hour; 
    519523        //declaracao do array() para receber o body de cada mensagem encontrada na busca sql realizada; 
    520524 
Note: See TracChangeset for help on using the changeset viewer.