From 16546abfab89df8dcf3168eaa7c0c346b8e400b4 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 09 Apr 2005 14:00:22 +0000 Subject: some fixes --- (limited to 'korganizer/koeditorgeneralevent.cpp') diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 2a49528..d4aa78c 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -376,20 +376,27 @@ void KOEditorGeneralEvent::setDuration() void KOEditorGeneralEvent::emitDateTimeStr() { KLocale *l = KGlobal::locale(); - - QString from,to; - if (mNoTimeButton->isChecked()) { - from = l->formatDate(mCurrStartDateTime.date()); - to = l->formatDate(mCurrEndDateTime.date()); + QString startString = ""; + if ( mCurrStartDateTime.date() < mCurrEndDateTime.date() ) { + if ( mNoTimeButton->isChecked() ) { + startString = i18n("From: ") + l->formatDate(mCurrStartDateTime.date() ); + startString += "\n"+i18n("To: ")+ l->formatDate(mCurrEndDateTime.date()); + + } else { + startString = i18n("From: ") +l->formatDateTime(mCurrStartDateTime, false); + startString += "\n"+i18n("To: ")+l->formatDateTime(mCurrEndDateTime, false); + } } else { - from = l->formatDateTime(mCurrStartDateTime); - to = l->formatDateTime(mCurrEndDateTime); + if ( mNoTimeButton->isChecked() ) { + startString = i18n("On: ") + l->formatDate(mCurrStartDateTime.date() ); + } else { + startString = i18n("From: ") + KGlobal::locale()->formatTime(mCurrStartDateTime.time())+ + "-"+KGlobal::locale()->formatTime(mCurrEndDateTime.time()); + startString += i18n(" on ")+KGlobal::locale()->formatDate( mCurrStartDateTime.date(), true); + } } - - QString str = i18n("From: %1 To: %2 %3").arg(from).arg(to) - .arg(mDurationLabel->text()); - - emit dateTimeStrChanged(str); + startString +="\n"+mDurationLabel->text(); + emit dateTimeStrChanged(startString); } bool KOEditorGeneralEvent::validateInput() -- cgit v0.9.0.2