DAV: another datereceived fix

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1174 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-12 12:43:42 +00:00
parent 6dd90d4b03
commit 1a5e963c1b
2 changed files with 4 additions and 3 deletions

View File

@ -572,7 +572,7 @@ public class DavExchangeSession extends ExchangeSession {
for (String attributeName : CONTACT_ATTRIBUTES) {
String value = getPropertyIfExists(properties, attributeName);
if (value != null) {
if ("bday".equals(attributeName) || "lastmodified".equals(attributeName)) {
if ("bday".equals(attributeName) || "lastmodified".equals(attributeName) || "datereceived".equals(attributeName)) {
value = convertDate(value);
}
put(attributeName, value);

View File

@ -98,7 +98,7 @@ public class TestExchangeSessionMessageFlags extends AbstractExchangeSessionTest
MimeMessage mimeMessage = createMimeMessage();
String messageName = UUID.randomUUID().toString();
HashMap<String, String> properties = new HashMap<String, String>();
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
SimpleDateFormat dateFormatter = ExchangeSession.getExchangeZuluDateFormat();
dateFormatter.setTimeZone(ExchangeSession.GMT_TIMEZONE);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
@ -108,7 +108,8 @@ public class TestExchangeSessionMessageFlags extends AbstractExchangeSessionTest
assertNotNull(messageList);
assertEquals(1, messageList.size());
assertNotNull(messageList);
assertEquals(properties.get("datereceived"), messageList.get(0).date);
// TODO: use same format for date read/write
assertEquals(ExchangeSession.getZuluDateFormat().format(cal.getTime()), messageList.get(0).date);
}