Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv17087
Modified Files:
DynamicDate.java
Log Message:
added a utility method to call both eval, getIntance and catch the exception
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util
Index: DynamicDate.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/DynamicDate.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- DynamicDate.java 18 Apr 2008 10:09:45 -0000 1.16
+++ DynamicDate.java 29 Jul 2008 15:25:39 -0000 1.17
@@ -51,6 +51,17 @@
}
/**
+ * @since MMBase-1.9
+ */
+ public static Date eval(final String format) {
+ try {
+ return eval(getInstance(format));
+ } catch (ParseException e) {
+ return new Date(-1);
+ }
+ }
+
+ /**
* Makes sure the argument 'date' is no DynamicDate any more. So this
returns a fixed date
* object when the argument is a DynamicDate and simply the argument if
it is not.
*/
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs