Revision: 4128 http://vexi.svn.sourceforge.net/vexi/?rev=4128&view=rev Author: clrg Date: 2011-05-12 00:41:37 +0000 (Thu, 12 May 2011)
Log Message: ----------- Feature. Add vexi.util.Date.copy(). Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/vexi/util/date.t Modified: trunk/org.vexi-vexi.widgets/src_main/vexi/util/date.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/vexi/util/date.t 2011-05-12 00:20:42 UTC (rev 4127) +++ trunk/org.vexi-vexi.widgets/src_main/vexi/util/date.t 2011-05-12 00:41:37 UTC (rev 4128) @@ -47,11 +47,11 @@ * compareTo(Date) compares the date object to another date, returning - -1 if before, 0 if the same, and 1 if greater + -1 if before, 0 if the same, and 1 if after * isDateInRange(Date1, Date2) compares the date object to another date, returning - -1 if before, 0 if the same, and 1 if greater + -1 if before, 0 if in the range, and 1 if after This template is useful as a preapply or as an alternative to the JS date object returned by vexi.date(). @@ -74,6 +74,7 @@ thisobj.compareTo = static.compareTo; thisobj.isDateInRange = static.isDateInRange; thisobj.parseDate = static.parseDate; + thisobj.copy = static.copy; thisobj.date ++= static.dateRead; thisobj.date ++= static.dateWrite; @@ -94,6 +95,15 @@ </js:Object> + /** creates a copy of the context date */ + static.copy = function() { + var d = .date(); + d.year = this.year; + d.month = this.month; + d.day = this.day; + return d; + } + /** date read trap */ static.dateRead = function() { if (!trapee.day or !trapee.month or !trapee.year) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn