File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 14
14
// AMD. Register as an anonymous module.
15
15
define ( [
16
16
"jquery" ,
17
+ "globalize" ,
17
18
"./core" ,
18
19
"./widget" ,
19
20
"./button"
23
24
// Browser globals
24
25
factory ( jQuery ) ;
25
26
}
26
- } ( function ( $ ) {
27
+ } ( function ( $ , Globalize ) {
27
28
28
29
function spinner_modifier ( fn ) {
29
30
return function ( ) {
@@ -407,19 +408,19 @@ return $.widget( "ui.spinner", {
407
408
408
409
_parse : function ( val ) {
409
410
if ( typeof val === "string" && val !== "" ) {
410
- val = window . Globalize && this . options . numberFormat ?
411
- Globalize . parseFloat ( val , 10 , this . options . culture ) : + val ;
411
+ // FIXME handle optional different locales
412
+ val = Globalize ? Globalize . parseNumber ( val ) : + val ;
412
413
}
414
+ // TODO: Why not to return NaN?
413
415
return val === "" || isNaN ( val ) ? null : val ;
414
416
} ,
415
417
416
418
_format : function ( value ) {
417
419
if ( value === "" ) {
418
420
return "" ;
419
421
}
420
- return window . Globalize && this . options . numberFormat ?
421
- Globalize . format ( value , this . options . numberFormat , this . options . culture ) :
422
- value ;
422
+ // FIXME handle optional different locales
423
+ return Globalize ? Globalize . formatNumber ( value , this . options . numberFormat ) : value ;
423
424
} ,
424
425
425
426
_refresh : function ( ) {
You can’t perform that action at this time.
0 commit comments