summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-02 13:00:32 (UTC)
committer zecke <zecke>2002-11-02 13:00:32 (UTC)
commit87504764286a40162d74b03f26e040d4142c0cab (patch) (side-by-side diff)
treed2dd2ccee3d42a8818a5adc2d63c609403ea04b3
parentffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a (diff)
downloadopie-87504764286a40162d74b03f26e040d4142c0cab.zip
opie-87504764286a40162d74b03f26e040d4142c0cab.tar.gz
opie-87504764286a40162d74b03f26e040d4142c0cab.tar.bz2
Until Opie is compatible to RFC2445 we will beam
vCal Events in local time. So lousy handys (my Nokia6210) gets the dates 'right'
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/event.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp
index 7cac314..7ccf16b 100644
--- a/library/backend/event.cpp
+++ b/library/backend/event.cpp
@@ -1086,16 +1086,50 @@ static inline VObject *safeAddPropValue( VObject *o, const char *prop, const QSt
static inline VObject *safeAddProp( VObject *o, const char *prop)
{
VObject *ret = 0;
if ( o )
ret = addProp( o, prop );
return ret;
}
+/*
+ * Until we support vCal/iCal right
+ * we will make DTSTART and other things
+ * be floating in the sense of
+ * RFC 2445
+ */
+namespace {
+/*
+ * Convert QDateTime to iso8601 but take
+ * local time and do not use the Z at the end
+ *
+ */
+ QCString toISOLocal( const QDateTime& dt ) {
+ QCString str;
+ /*
+ * year month day T Hour Minute Second
+ * 4 2 2 2 2 2 digits
+ */
+ str.sprintf("%04d%02d%02dT%02d%02d%02d",
+ dt.date().year(),
+ dt.date().month(),
+ dt.date().year(),
+ dt.time().hour(),
+ dt.time().minute(),
+ dt.time().second() );
+
+
+
+ return str;
+ }
+
+
+};
+
static VObject *createVObject( const Event &e )
{
VObject *vcal = newVObject( VCCalProp );
safeAddPropValue( vcal, VCVersionProp, "1.0" );
VObject *event = safeAddProp( vcal, VCEventProp );
safeAddPropValue( event, VCDTstartProp, TimeConversion::toISO8601( e.start() ) );
safeAddPropValue( event, VCDTendProp, TimeConversion::toISO8601( e.end() ) );