const String
_DateTimeUtils::GetMonthString(int month) const
{
+ result r = E_SUCCESS;
String text;
text.Clear();
DateTimeSymbols dateSymbols;
- dateSymbols.Construct(CALENDAR_GREGORIAN);
+ r = dateSymbols.Construct(CALENDAR_GREGORIAN);
+
+ if (r != E_SUCCESS)
+ {
+ text.Append(GetEnglishMonthString(month));
+ return text;
+ }
const IList* pListOfShortMonths = dateSymbols.GetShortMonths();
SysTryReturn(NID_UI_CTRL, (pListOfShortMonths != null), text, E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfShortMonths is null.");
return text;
}
+const String
+_DateTimeUtils::GetEnglishMonthString(int month) const
+{
+ String text;
+ text.Clear();
+ switch (month)
+ {
+ case 1:
+ text.Append("Jan");
+ break;
+
+ case 2:
+ text.Append("Feb");
+ break;
+
+ case 3:
+ text.Append("Mar");
+ break;
+
+ case 4:
+ text.Append("Apr");
+ break;
+
+ case 5:
+ text.Append("May");
+ break;
+
+ case 6:
+ text.Append("Jun");
+ break;
+
+ case 7:
+ text.Append("Jul");
+ break;
+
+ case 8:
+ text.Append("Aug");
+ break;
+
+ case 9:
+ text.Append("Sep");
+ break;
+
+ case 10:
+ text.Append("Oct");
+ break;
+
+ case 11:
+ text.Append("Nov");
+ break;
+
+ case 12:
+ text.Append("Dec");
+ break;
+
+ default:
+ break;
+ }
+ return text;
+}
+
int
_DateTimeUtils::CalculateMaxDay(int displayYear, int month) const
{
void
_DateTimeUtils::GetAmPm(String& timeFormat, _AmPmType amPmType) const
{
+ result r = E_SUCCESS;
DateTimeSymbols dateSymbols;
- dateSymbols.Construct(CALENDAR_GREGORIAN);
+
+ r = dateSymbols.Construct(CALENDAR_GREGORIAN);
+
+ if (r != E_SUCCESS)
+ {
+ if (amPmType == AM_TYPE)
+ {
+ timeFormat.Append("AM");
+ }
+ else
+ {
+ timeFormat.Append("PM");
+ }
+ return;
+ }
const IList* pListOfAmPm = dateSymbols.GetAmPm();
SysTryReturnVoidResult(NID_UI_CTRL, (pListOfAmPm != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfAmPm is null.");
// Operations
public:
const Tizen::Base::String GetMonthString(int month) const;
+ const Tizen::Base::String GetEnglishMonthString(int month) const;
const Tizen::Base::String GetFullMonthString(int month) const;
int CalculateMaxDay(int displayYear, int month) const ;
bool IsLeapYear(int year) const;