Author: adrianc
Date: Tue Jul 1 09:27:15 2008
New Revision: 673129
URL:
http://svn.apache.org/viewvc?rev=673129&view=revLog:
Bug fix for set-calendar simple method operation.
Modified:
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java
Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java?rev=673129&r1=673128&r2=673129&view=diff==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java (original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java Tue Jul 1 09:27:15 2008
@@ -132,13 +132,13 @@
}
// Convert Strings to ints
- int years = Integer.parseInt("0" + methodContext.expandString(this.yearsExdr));
- int months = Integer.parseInt("0" + methodContext.expandString(this.monthsExdr));
- int days = Integer.parseInt("0" + methodContext.expandString(this.daysExdr));
- int hours = Integer.parseInt("0" + methodContext.expandString(this.hoursExdr));
- int minutes = Integer.parseInt("0" + methodContext.expandString(this.minutesExdr));
- int seconds = Integer.parseInt("0" + methodContext.expandString(this.secondsExdr));
- int millis = Integer.parseInt("0" + methodContext.expandString(this.millisExdr));
+ int years = this.yearsExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.yearsExdr));
+ int months = this.monthsExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.monthsExdr));
+ int days = this.daysExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.daysExdr));
+ int hours = this.hoursExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.hoursExdr));
+ int minutes = this.minutesExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.minutesExdr));
+ int seconds = this.secondsExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.secondsExdr));
+ int millis = this.millisExdr.isEmpty() ? 0 : Integer.parseInt(methodContext.expandString(this.millisExdr));
// Adjust calendar
Calendar cal = UtilDateTime.toCalendar(fromStamp, timeZone, locale);