calendarui/caleneditor/src/caleneditorcustomitem.cpp
changeset 75 7ac58b2aae6f
parent 70 a5ed90760192
--- a/calendarui/caleneditor/src/caleneditorcustomitem.cpp	Mon Sep 06 15:58:44 2010 +0530
+++ b/calendarui/caleneditor/src/caleneditorcustomitem.cpp	Mon Sep 20 12:44:39 2010 +0530
@@ -339,6 +339,22 @@
 												r_qtn_date_usual_with_zero));
 	mPushButtonTime->setText(mLocale.format(defaultDateTime.time(), 
 												r_qtn_time_usual_with_zero));
+												
+	// If the date/time pickers for start date/end date are open and 
+	// locale changes happen, we need to refresh them with proper date/time formats
+	if(!(mDatePicker.isNull())) {
+		mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString());
+		mDatePicker->setDate(mDate);
+	}
+	if(!(mTimePicker.isNull())) {
+		if(mLocale.timeStyle() == HbExtendedLocale::Time12) {
+			mTimePicker->setDisplayFormat("hh:mm ap");	
+		}else {
+			mTimePicker->setDisplayFormat("hh:mm");
+		}
+		mTimePicker->setTime(mTime);
+	}
+		
 	OstTraceFunctionExit0( CALENEDITORCUSTOMITEM_POPULATEDATETIME_EXIT );
 }
 
@@ -440,6 +456,7 @@
 	mDatePicker = new HbDateTimePicker(mDate, popUp);
 	mDatePicker->setMinimumDate(mMinDate);
 	mDatePicker->setMaximumDate(mMaxDate);
+	mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString());
 	mDatePicker->setDate(mDate);
 	popUp->setContentWidget(mDatePicker);
 	HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok"), popUp);