Revision: 3786 http://vexi.svn.sourceforge.net/vexi/?rev=3786&view=rev Author: jeffbuhrt Date: 2010-01-26 19:12:11 +0000 (Tue, 26 Jan 2010)
Log Message: ----------- added: allowzeroday="true" allows the day to be zero (for selecting a whole month (account period)) Modified Paths: -------------- trunk/widgets/org.vexi.widgets/src/vexi/util/date.t Modified: trunk/widgets/org.vexi.widgets/src/vexi/util/date.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/vexi/util/date.t 2010-01-22 13:32:46 UTC (rev 3785) +++ trunk/widgets/org.vexi.widgets/src/vexi/util/date.t 2010-01-26 19:12:11 UTC (rev 3786) @@ -30,6 +30,9 @@ * weekday the day of the week + + * allowzeroday + when true allows the day to be zero (for selecting a whole month (account period)) This date object also comes with several helper functions: @@ -90,17 +93,21 @@ /** constrain days */ static.dayWrite = function(v) { if (v != null) { - if (typeof(v)=="string") v = vexi.string.parseInt(v); - // NOTE: the order of the monthday +=/-= and month ++/-- - // is important and dependent on days surplus / shortage - while (v>trapee.monthdays) { - v -= trapee.monthdays; - trapee.month++; + if (trapee.allowzeroday and v == 0) + ; + else { + if (typeof(v)=="string") v = vexi.string.parseInt(v); + // NOTE: the order of the monthday +=/-= and month ++/-- + // is important and dependent on days surplus / shortage + while (v>trapee.monthdays) { + v -= trapee.monthdays; + trapee.month++; + } + while (1>v) { + trapee.month--; + v += trapee.monthdays; + } } - while (1>v) { - trapee.month--; - v += trapee.monthdays; - } } cascade = v; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn