You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/12/05 15:57:29 UTC

svn commit: r1417460 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js

Author: lofwyr
Date: Wed Dec  5 14:57:28 2012
New Revision: 1417460

URL: http://svn.apache.org/viewvc?rev=1417460&view=rev
Log:
TOBAGO-1223: time component (tx:time) without number and lost focus then print NaN

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js?rev=1417460&r1=1417459&r2=1417460&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js Wed Dec  5 14:57:28 2012
@@ -351,6 +351,7 @@ Tobago.Time.setValueField = function (ti
 
 Tobago.Time.setValue = function (input, value) {
   var max = input.data("tobago-max");
+  value = parseInt(value);
   while (value >= max) {
     value -= max;
   }
@@ -437,11 +438,9 @@ Tobago.Time.focus = function (input) {
 };
 
 Tobago.Time.blur = function (input) {
-  var value = input.val();
+  var value = parseInt(input.val(), 10); // use 10 to avoid parsing octal numbers, if the string begins with 0
   if (isNaN(value)) {
     value = input.data("tobago-oldvalue");
-  } else {
-    value = parseInt(value, 10); // use 10 to avoid parsing octal numbers, if the string begins with 0
   }
   Tobago.Time.setValue(input, value);