svn commit: r792136 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r792136 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

apatel-2
Author: apatel
Date: Wed Jul  8 13:43:36 2009
New Revision: 792136

URL: http://svn.apache.org/viewvc?rev=792136&view=rev
Log:
Convert monthNumber to string. Form widget options list does not like Integer as value of entry.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=792136&r1=792135&r2=792136&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Wed Jul  8 13:43:36 2009
@@ -962,14 +962,14 @@
      * @param locale
      * @return List of month number, name
      */
-    public static List<Map<String,Object>> getMonths(Locale locale) {
+    public static List<Map<String,String>> getMonths(Locale locale) {
         Calendar tempCal = Calendar.getInstance(locale);
         tempCal.set(Calendar.MONTH, Calendar.JANUARY);
         SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM", locale);
-        List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
+        List<Map<String,String>> resultList = new ArrayList<Map<String,String>>();
         for (int i = Calendar.JANUARY; i <= tempCal.getActualMaximum(Calendar.MONTH); i++) {
-            Map<String,Object> monthEntry = new FastMap<String,Object>();
-            monthEntry.put("monthNumber",tempCal.get(Calendar.MONTH));
+            Map<String,String> monthEntry = new FastMap<String,String>();
+            monthEntry.put("monthNumber",String.valueOf(tempCal.get(Calendar.MONTH)));
             monthEntry.put("monthName",dateFormat.format(tempCal.getTime()));
             resultList.add(monthEntry);
             tempCal.roll(Calendar.MONTH, 1);