37 #include <klocalizedstring.h>
39 #include <ksystemtimezone.h>
48 class KCal::Event::Private
52 : mHasEndDate( false ),
53 mTransparency( Opaque )
55 Private(
const KCal::Event::Private &other )
56 : mDtEnd( other.mDtEnd ),
57 mHasEndDate( other.mHasEndDate ),
58 mTransparency( other.mTransparency )
63 Transparency mTransparency;
68 : d( new KCal::
Event::Private )
84 return new Event( *
this );
90 if ( &other ==
this ) {
103 dtEnd() ==
event.dtEnd() &&
159 return end.addSecs(-1).date();
165 if ( spec.isValid() ) {
168 if ( spec.timeZone() != KSystemTimeZones::local() ) {
169 timeZone =
' ' + spec.timeZone().name();
172 return KGlobal::locale()->formatTime(
173 dtEnd().toTimeSpec( spec ).time(), !shortfmt ) + timeZone;
175 return KGlobal::locale()->formatTime(
dtEnd().time(), !shortfmt );
181 if ( spec.isValid() ) {
184 if ( spec.timeZone() != KSystemTimeZones::local() ) {
185 timeZone =
' ' + spec.timeZone().name();
188 return KGlobal::locale()->formatDate(
189 dtEnd().toTimeSpec( spec ).date(),
190 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) ) + timeZone;
192 return KGlobal::locale()->formatDate(
194 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) );
204 if ( spec.isValid() ) {
207 if ( spec.timeZone() != KSystemTimeZones::local() ) {
208 timeZone =
' ' + spec.timeZone().name();
211 return KGlobal::locale()->formatDateTime(
212 dtEnd().toTimeSpec( spec ).dateTime(),
213 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) ) + timeZone;
215 return KGlobal::locale()->formatDateTime(
217 ( shortfmt ? KLocale::ShortDate : KLocale::LongDate ) );
228 return d->mHasEndDate;
234 KDateTime start, end;
235 if ( spec.isValid() ) {
236 start =
dtStart().toTimeSpec( spec );
237 end =
dtEnd().toTimeSpec( spec );
244 end = end.addSecs( -1 );
247 bool multi = ( start.date() != end.date() && start <= end );
252 const KDateTime::Spec &newSpec )
256 d->mDtEnd = d->mDtEnd.toTimeSpec( oldSpec );
257 d->mDtEnd.setTimeSpec( newSpec );
272 return d->mTransparency;