summaryrefslogtreecommitdiffabout
path: root/libkcal/vcalformat.cpp
Unidiff
Diffstat (limited to 'libkcal/vcalformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/vcalformat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 4727a7a..309c699 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -1471,33 +1471,33 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
1471 1471
1472 tmpStr = dtStr; 1472 tmpStr = dtStr;
1473 year = tmpStr.left(4).toInt(); 1473 year = tmpStr.left(4).toInt();
1474 month = tmpStr.mid(4,2).toInt(); 1474 month = tmpStr.mid(4,2).toInt();
1475 day = tmpStr.mid(6,2).toInt(); 1475 day = tmpStr.mid(6,2).toInt();
1476 hour = tmpStr.mid(9,2).toInt(); 1476 hour = tmpStr.mid(9,2).toInt();
1477 minute = tmpStr.mid(11,2).toInt(); 1477 minute = tmpStr.mid(11,2).toInt();
1478 second = tmpStr.mid(13,2).toInt(); 1478 second = tmpStr.mid(13,2).toInt();
1479 tmpDate.setYMD(year, month, day); 1479 tmpDate.setYMD(year, month, day);
1480 tmpTime.setHMS(hour, minute, second); 1480 tmpTime.setHMS(hour, minute, second);
1481 1481
1482 ASSERT(tmpDate.isValid()); 1482 ASSERT(tmpDate.isValid());
1483 ASSERT(tmpTime.isValid()); 1483 ASSERT(tmpTime.isValid());
1484 QDateTime tmpDT(tmpDate, tmpTime); 1484 QDateTime tmpDT(tmpDate, tmpTime);
1485 // correct for GMT if string is in Zulu format 1485 // correct for GMT if string is in Zulu format
1486 if (dtStr.at(dtStr.length()-1) == 'Z') 1486 if (dtStr.at(dtStr.length()-1) == 'Z')
1487 tmpDT = tmpDT.addSecs(60*mCalendar->getTimeZone()); 1487 tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60);
1488 return tmpDT; 1488 return tmpDT;
1489} 1489}
1490 1490
1491QDate VCalFormat::ISOToQDate(const QString &dateStr) 1491QDate VCalFormat::ISOToQDate(const QString &dateStr)
1492{ 1492{
1493 int year, month, day; 1493 int year, month, day;
1494 1494
1495 year = dateStr.left(4).toInt(); 1495 year = dateStr.left(4).toInt();
1496 month = dateStr.mid(4,2).toInt(); 1496 month = dateStr.mid(4,2).toInt();
1497 day = dateStr.mid(6,2).toInt(); 1497 day = dateStr.mid(6,2).toInt();
1498 1498
1499 return(QDate(year, month, day)); 1499 return(QDate(year, month, day));
1500} 1500}
1501 1501
1502// take a raw vcalendar (i.e. from a file on disk, clipboard, etc. etc. 1502// take a raw vcalendar (i.e. from a file on disk, clipboard, etc. etc.
1503// and break it down from it's tree-like format into the dictionary format 1503// and break it down from it's tree-like format into the dictionary format