author | zautrix <zautrix> | 2005-04-09 14:00:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-09 14:00:22 (UTC) |
commit | 16546abfab89df8dcf3168eaa7c0c346b8e400b4 (patch) (side-by-side diff) | |
tree | c5bad46ec2ee88cb1f6b1035dbfe1e367ee0cb0e /korganizer/koeditorgeneralevent.cpp | |
parent | ab7957df1a71a392d71cb898b59a35c32461ec6a (diff) | |
download | kdepimpi-16546abfab89df8dcf3168eaa7c0c346b8e400b4.zip kdepimpi-16546abfab89df8dcf3168eaa7c0c346b8e400b4.tar.gz kdepimpi-16546abfab89df8dcf3168eaa7c0c346b8e400b4.tar.bz2 |
some fixes
Diffstat (limited to 'korganizer/koeditorgeneralevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 2a49528..d4aa78c 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -375,22 +375,29 @@ 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() { |