Revision: 2878 http://vexi.svn.sourceforge.net/vexi/?rev=2878&view=rev Author: clrg Date: 2008-04-17 02:43:31 -0700 (Thu, 17 Apr 2008)
Log Message: ----------- Fix text and value bugs in fields for date/time/datetime Modified Paths: -------------- trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datefield.t trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datetime.t trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/timefield.t Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datefield.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datefield.t 2008-04-17 09:41:42 UTC (rev 2877) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datefield.t 2008-04-17 09:43:31 UTC (rev 2878) @@ -38,7 +38,7 @@ </layout.border> thisbox.textformat = "YYYYMMDD"; - thisbox.textseparator = null; + thisbox.textseparator = "-"; thisbox.viewformat = "DDMMYYYY"; thisbox.viewseparator = "/"; @@ -266,10 +266,16 @@ static.textRead = function() { var s = trapee.textseparator ? trapee.textseparator : trapee.viewseparator; var f = trapee.textformat ? trapee.textformat : trapee.viewformat; + var y = trapee.year; + var m = trapee.month; + var d = trapee.day; + if (y==null or m==null or d==null) return ""; + if (10>m) m = "0"+m; + if (10>d) d = "0"+d; switch (f) { - case "YYYYMMDD": return ""+trapee.year + s + trapee.month + s + trapee.day; - case "DDMMYYYY": return ""+trapee.day + s + trapee.month + s + trapee.year; - case "MMDDYYYY": return ""+trapee.month + s + trapee.day + s + trapee.year; + case "YYYYMMDD": return ""+ y + s + m + s + d; + case "DDMMYYYY": return ""+ d + s + m + s + y; + case "MMDDYYYY": return ""+ m + s + d + s + y; default: return ""; } } Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datetime.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datetime.t 2008-04-17 09:41:42 UTC (rev 2877) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/datetime.t 2008-04-17 09:43:31 UTC (rev 2878) @@ -25,6 +25,7 @@ switch (typeof(v)) { case "string": v = vexi.date(v); + value = v; break; case "date": case "null": Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/timefield.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/timefield.t 2008-04-17 09:41:42 UTC (rev 2877) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/contrib/timefield.t 2008-04-17 09:43:31 UTC (rev 2878) @@ -85,13 +85,17 @@ $period.Press1 ++= selectPart; $more.action ++= function(v) { + if (hours==null or mins==null) { + if (hours==null) hours = 0; + if (mins==null) mins = 0; + return; + } if (selected == $period) { if (12>hours) hours += 12; } else if (selected == $hours) { - hours = hours==null ? 0 : hours+1; + hours = hours+1; } else if (selected == $mins) { - if (hours == null) hours = 0; - mins = mins==null ? 0 : mins+1; + mins = mins+1; } return; } @@ -238,6 +242,7 @@ var h = trapee.hours; var m = trapee.mins; var s = trapee.secs; + if (h==null or m==null) return ""; return (h>9?"":"0")+h+":"+(m>9?"":"0")+m+":00";//+(s>0?"":"0")+s; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn