@@ -447,8 +447,8 @@ _.extend(DatetimeFormatter.prototype, {
447447 if ( ( data + '' ) . trim ( ) === '' ) return null ;
448448
449449 var date , time = null ;
450+ var jsDate = new Date ( data ) ;
450451 if ( _ . isNumber ( data ) ) {
451- var jsDate = new Date ( data ) ;
452452 date = lpad ( jsDate . getUTCFullYear ( ) , 4 , 0 ) + '-' + lpad ( jsDate . getUTCMonth ( ) + 1 , 2 , 0 ) + '-' + lpad ( jsDate . getUTCDate ( ) , 2 , 0 ) ;
453453 time = lpad ( jsDate . getUTCHours ( ) , 2 , 0 ) + ':' + lpad ( jsDate . getUTCMinutes ( ) , 2 , 0 ) + ':' + lpad ( jsDate . getUTCSeconds ( ) , 2 , 0 ) ;
454454 }
@@ -469,7 +469,7 @@ _.extend(DatetimeFormatter.prototype, {
469469 if ( ! this . includeTime && time ) return ;
470470 }
471471
472- var jsDate = new Date ( Date . UTC ( YYYYMMDD [ 1 ] * 1 || 0 ,
472+ jsDate = new Date ( Date . UTC ( YYYYMMDD [ 1 ] * 1 || 0 ,
473473 YYYYMMDD [ 2 ] * 1 - 1 || 0 ,
474474 YYYYMMDD [ 3 ] * 1 || 0 ,
475475 HHmmssSSS [ 1 ] * 1 || null ,
@@ -1348,16 +1348,17 @@ var BooleanCellEditor = Backgrid.BooleanCellEditor = CellEditor.extend({
13481348 }
13491349
13501350 var $el = this . $el ;
1351+ var val = null ;
13511352 if ( command . save ( ) || command . moveLeft ( ) || command . moveRight ( ) || command . moveUp ( ) ||
13521353 command . moveDown ( ) ) {
13531354 e . preventDefault ( ) ;
13541355 e . stopPropagation ( ) ;
1355- var val = formatter . toRaw ( $el . prop ( "checked" ) , model ) ;
1356+ val = formatter . toRaw ( $el . prop ( "checked" ) , model ) ;
13561357 model . set ( column . get ( "name" ) , val ) ;
13571358 model . trigger ( "backgrid:edited" , model , column , command ) ;
13581359 }
13591360 else if ( e . type == "change" ) {
1360- var val = formatter . toRaw ( $el . prop ( "checked" ) , model ) ;
1361+ val = formatter . toRaw ( $el . prop ( "checked" ) , model ) ;
13611362 model . set ( column . get ( "name" ) , val ) ;
13621363 $el . focus ( ) ;
13631364 }
0 commit comments