NABI_SE issues resolved
[apps/osp/MyFiles.git] / src / MfUtility.cpp
index 955a7d5..24c79f8 100644 (file)
@@ -104,13 +104,28 @@ MfUtility::ConvertDateTimeToString(Tizen::Base::DateTime fileCreationTime)
        DateTime dirCreationTime;\r
        Locale locale(LANGUAGE_ENG, COUNTRY_US);\r
 \r
+       String timeFormatKeyName(L"TimeFormat");\r
+       int timeFormatSelected = TIME_FORMAT_NONE;\r
+       AppRegistry* pAppRegistry = null;\r
+\r
        dirCreationTime = fileCreationTime;\r
+       pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();\r
 \r
        pDateFormatter = DateTimeFormatter::CreateDateFormatterN(locale, DATE_TIME_STYLE_DEFAULT);\r
        TryCatch(pDateFormatter != null, dateAndTime.Append("Not Found"), "Failed to get date time formatter");\r
 \r
+       pAppRegistry->Get(timeFormatKeyName, timeFormatSelected);\r
+\r
        // Customized pattern\r
-       cutomizedPattern.Append(L"d MMM, yyyy HH:mm");\r
+       if (timeFormatSelected == TIME_FORMAT_24_HOUR)\r
+       {\r
+               cutomizedPattern.Append(L"d MMM, yyyy HH:mm");\r
+       }\r
+       else\r
+       {\r
+               cutomizedPattern.Append(L"d MMM, yyyy hh:mm a");\r
+       }\r
+\r
        pDateFormatter->ApplyPattern(cutomizedPattern);\r
 \r
        // Format creation time with date formatter\r