Fixed issue 19228. Date format will be set in the query so that there is no issue when changing the date format
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 14 Dec 2011 11:53:55 +0100
changeset 14876 439027d73f6b
parent 14875 61149227461b
child 14877 73dffb963e51
Fixed issue 19228. Date format will be set in the query so that there is no issue when changing the date format
src/org/openbravo/scheduling/OBScheduler.java
src/org/openbravo/scheduling/Trigger_data.xsql
--- a/src/org/openbravo/scheduling/OBScheduler.java	Wed Dec 14 11:29:24 2011 +0100
+++ b/src/org/openbravo/scheduling/OBScheduler.java	Wed Dec 14 11:53:55 2011 +0100
@@ -362,7 +362,6 @@
 
       Calendar start = null;
       Calendar finish = null;
-
       try {
         final String timingOption = data.timingOption;
         if ("".equals(timingOption) || timingOption.equals(TIMING_OPTION_IMMEDIATE)) {
@@ -370,11 +369,11 @@
 
         } else if (data.timingOption.equals(TIMING_OPTION_LATER)) {
           trigger = new SimpleTrigger();
-          start = timestamp(data.startDate, data.startTime, dateTimeFormat);
+          start = timestamp(data.startDate, data.startTime, "dd-MM-yyyy HH:mm:ss");
           trigger.setStartTime(start.getTime());
 
         } else if (data.timingOption.equals(TIMING_OPTION_SCHEDULED)) {
-          start = timestamp(data.startDate, data.startTime, dateTimeFormat);
+          start = timestamp(data.startDate, data.startTime, "dd-MM-yyyy HH:mm:ss");
 
           final int second = start.get(Calendar.SECOND);
           final int minute = start.get(Calendar.MINUTE);
@@ -473,12 +472,12 @@
             trigger.setStartTime(start.getTime());
           } else {
             Calendar nextTriggerTime = timestamp(data.nextFireTime, data.nextFireTime,
-                dateTimeFormat);
+                "dd-MM-yyyy HH:mm:ss");
             trigger.setStartTime(nextTriggerTime.getTime());
           }
 
           if (data.finishes.equals(FINISHES)) {
-            finish = timestamp(data.finishesDate, data.finishesTime, dateTimeFormat);
+            finish = timestamp(data.finishesDate, data.finishesTime, "dd-MM-yyyy HH:mm:ss");
             trigger.setEndTime(finish.getTime());
           }
 
--- a/src/org/openbravo/scheduling/Trigger_data.xsql	Wed Dec 14 11:29:24 2011 +0100
+++ b/src/org/openbravo/scheduling/Trigger_data.xsql	Wed Dec 14 11:53:55 2011 +0100
@@ -22,11 +22,11 @@
    <SqlMethod name="select" type="preparedStatement" return="single">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[
-      	SELECT AD_Process_Request_ID, Timing_Option, TO_CHAR(Start_Time, 'HH24:MI:SS') AS Start_Time, Start_Date,
+      	SELECT AD_Process_Request_ID, Timing_Option, TO_CHAR(Start_Time, 'HH24:MI:SS') AS Start_Time, to_char(Start_Date, 'dd-MM-yyyy HH:mm:ss') AS Start_Date,
       	Frequency, Secondly_Interval, Secondly_Repetitions, Minutely_Interval, Minutely_Repetitions,
       	Hourly_Interval, Hourly_Repetitions, Daily_Interval, Day_Mon, Day_Tue,
       	Day_Wed, Day_Thu, Day_Fri, Day_Sat, Day_Sun, Monthly_Option, Monthly_Specific_Day,
-      	Monthly_Day_Of_Week, Finishes, TO_CHAR(Finishes_Time, 'HH24:MI:SS') AS Finishes_Time, Finishes_Date,
+      	Monthly_Day_Of_Week, Finishes, TO_CHAR(Finishes_Time, 'HH24:MI:SS') AS Finishes_Time, to_char(Finishes_Date, 'dd-MM-yyyy HH:mm:ss') as Finishes_Date,
       	Daily_Option, Cron, Description, TO_CHAR(Next_Fire_Time, ?) AS Next_Fire_Time
       	FROM AD_Process_Request
       	WHERE AD_Process_Request_ID = ?