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 16:07:21 UTC

svn commit: r1417466 - /myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js

Author: lofwyr
Date: Wed Dec  5 15:07:20 2012
New Revision: 1417466

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

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js?rev=1417466&r1=1417465&r2=1417466&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js Wed Dec  5 15:07:20 2012
@@ -281,6 +281,7 @@ function tbgGetTimeInput(imageButton) {
 
 function tbgSetTimeInputValue(input, value) {
 
+  value = parseInt(value);
 //  LOG.debug("value = " + value);
   if (input.parentNode.parentNode.hourMode) {
     if (value < 0) {
@@ -356,9 +357,9 @@ function tbgTimerInputFocus(input, hour)
 
 function tbgTimerInputBlur(input) {
 //  LOG.debug("value XX = " + input.value);
-  var value = parseInt(input.value, 10);
+  var value = parseInt(input.value, 10); // use 10 to avoid parsing octal numbers, if the string begins with 0
 //  LOG.debug("value 3  = " + value);
-  if (value == NaN) {
+  if (isNaN(value)) {
     input.value = input.oldValue;
     return;
   }