2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_DateTimeUtils.cpp
20 * @brief This is the implementation file for the _DateTimeUtils class.
23 #include <FBaseDateTime.h>
24 #include <FLclDateTimeSymbols.h>
25 #include "FUiCtrl_DateTimeUtils.h"
26 #include "FUi_ResourceManager.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Locales;
30 using namespace Tizen::Base::Collection;
32 namespace Tizen { namespace Ui { namespace Controls
35 _DateTimeUtils::~_DateTimeUtils(void)
39 _DateTimeUtils::_DateTimeUtils(void)
44 _DateTimeUtils::GetMonthString(int month) const
49 DateTimeSymbols dateSymbols;
50 dateSymbols.Construct(CALENDAR_GREGORIAN);
52 const IList* pListOfShortMonths = dateSymbols.GetShortMonths();
53 SysTryReturn(NID_LCL, (pListOfShortMonths != null), text, E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfShortMonths is null.");
56 pObj = static_cast<String*>(const_cast<Object*>(pListOfShortMonths->GetAt(month - 1)));
67 _DateTimeUtils::CalculateMaxDay(int displayYear, int month) const
89 if (IsLeapYear(displayYear))
107 _DateTimeUtils::IsLeapYear(int year) const
109 return DateTime::IsLeapYear(year);
113 _DateTimeUtils::GetAmPm(String& timeFormat, _AmPmType amPmType) const
115 DateTimeSymbols dateSymbols;
116 dateSymbols.Construct(CALENDAR_GREGORIAN);
118 const IList* pListOfAmPm = dateSymbols.GetAmPm();
119 SysTryReturnVoidResult(NID_LCL, (pListOfAmPm != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfAmPm is null.");
122 pObj = static_cast<String*>(const_cast<Object*>(pListOfAmPm->GetAt(amPmType)));
126 timeFormat.Append(*pObj);
133 _DateTimeUtils::GetFullMonthString(int month) const
138 DateTimeSymbols dateSymbols;
139 dateSymbols.Construct(CALENDAR_GREGORIAN);
141 const IList* pListOfFullMonths = dateSymbols.GetMonths();
142 SysTryReturn(NID_LCL, (pListOfFullMonths != null), text, E_SYSTEM, "[E_SYSTEM] A system error has occurred. pListOfFullMonths is null.");
145 pObj = static_cast<String*>(const_cast<Object*>(pListOfFullMonths->GetAt(month - 1)));
154 }}} // Tizen::Ui::Controls