[Yanel-commits] rev 47080 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/scheduler

michi at wyona.com michi at wyona.com
Sat Jan 16 00:09:41 CET 2010


Author: michi
Date: 2010-01-16 00:09:40 +0100 (Sat, 16 Jan 2010)
New Revision: 47080

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/scheduler/QuartzSchedulerUtil.java
Log:
check if start date it set to NOW

Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/scheduler/QuartzSchedulerUtil.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/scheduler/QuartzSchedulerUtil.java	2010-01-15 23:09:07 UTC (rev 47079)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/scheduler/QuartzSchedulerUtil.java	2010-01-15 23:09:40 UTC (rev 47080)
@@ -49,10 +49,14 @@
             Date startDate = new Date();
             String startDateA = triggerElement.getAttribute("startDate");
             if (startDateA != null && startDateA.length() > 0) {
-                try {
-                    startDate = new java.text.SimpleDateFormat("yyyy.MM.dd'T'HH:mm:ss").parse(startDateA);
-                } catch(java.text.ParseException e) {
-                    log.error("Could not parse startDate: " + e.getMessage());
+                if (startDateA.equals("NOW")) {
+                    startDate = new Date();
+                } else {
+                    try {
+                        startDate = new java.text.SimpleDateFormat("yyyy.MM.dd'T'HH:mm:ss").parse(startDateA);
+                    } catch(java.text.ParseException e) {
+                        log.error("Could not parse startDate: " + e.getMessage() + " (Use NOW as start date)");
+                    }
                 }
             }
 
@@ -62,7 +66,7 @@
                 try {
                     endDate = new java.text.SimpleDateFormat("yyyy.MM.dd'T'HH:mm:ss").parse(endDateA);
                 } catch(java.text.ParseException e) {
-                    log.error("Could not parse endDate: " + e.getMessage());
+                    log.error("Could not parse endDate: " + e.getMessage() + " (No end date set)");
                 }
             }
 



More information about the Yanel-commits mailing list