calendarui/commonutils/src/calendateutils.cpp
changeset 75 7ac58b2aae6f
parent 55 2c54b51f39c4
child 89 b57382753122
--- a/calendarui/commonutils/src/calendateutils.cpp	Mon Sep 06 15:58:44 2010 +0530
+++ b/calendarui/commonutils/src/calendateutils.cpp	Mon Sep 20 12:44:39 2010 +0530
@@ -23,6 +23,8 @@
 #include "calendateutils.h"
 #include <agendautil.h>
 
+#include <hbextendedlocale.h>
+
 //  LOCAL CONSTANTS AND MACROS
 const int KDefaultStartTime(8);    // 8 am ( 0 to 23 hour scale)
 
@@ -266,4 +268,42 @@
      result.setTime(dateTime.time());
      return result;
      }
+ 
+ /*!
+	 Retruns the dateformat based current locale settings.
+  */
+ QString CalenDateUtils::dateFormatString()
+ {
+	 HbExtendedLocale locale = HbExtendedLocale::system();
+ 
+	 QString dateFormat;
+	 switch (locale.dateStyle()) {
+		 case HbExtendedLocale::American:
+			 dateFormat.append("MM");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("dd");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("yyyy");
+			 break;
+ 
+		 case HbExtendedLocale::European:
+			 dateFormat.append("dd");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("MM");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("yyyy");
+			 break;
+ 
+		 case HbExtendedLocale::Japanese:
+			 dateFormat.append("yyyy");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("MM");
+			 dateFormat.append(locale.dateSeparator(1));
+			 dateFormat.append("dd");
+			 break;
+	 }
+ 
+	 return dateFormat;
+ }
+ 
 // End of File