Skip to main content

Search and Top Navigation

#15030 open bug ()

Opened August 15, 2016 04:33PM UTC

Last modified September 01, 2016 12:28PM UTC

Incompatibility with Globalize v1.x

Reported by: erikcordeiro Owned by:
Priority: blocker Milestone: 1.13.0
Component: ui.spinner Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:
Description

The Spinner widget uses Globalize functions that are no longer supported in the current version of the library (1.x).

That functions are: Globalize.parseFloat and Globalize.format which were replaced respectively by Globalize.parseNumber and Globalize.formatNumber.

https://github.com/jquery/globalize/blob/master/doc/migrating-from-0.x.md#globalizeformat

https://github.com/jquery/globalize/blob/master/doc/migrating-from-0.x.md#globalizeparseintparsefloat

--> master/ui/widgets/spinner.js

(...)
_parse: function( val ) {
	if ( typeof val === "string" && val !== "" ) {
		val = window.Globalize && this.options.numberFormat ? Globalize.parseFloat( val, 10, this.options.culture ) : +val;
	}
	return val === "" || isNaN( val ) ? null : val;
},

_format: function( value ) {
	if ( value === "" ) {
		return "";
	}
	return window.Globalize && this.options.numberFormat ? Globalize.format( value, this.options.numberFormat, this.options.culture ) : value;
},
(...)

My suggestion is to test the version of Globalize to switch the correct functions.

Attachments (0)
Change History (2)

Changed August 19, 2016 01:04AM UTC by scottgonzalez comment:1

milestone: none1.12.1
priority: minorblocker
status: newopen

Changed September 01, 2016 12:28PM UTC by scottgonzalez comment:2

milestone: 1.12.11.13.0

The changes are too big, because we support more than just number formats. We already have API changes for spinner planned for 1.13 which will remove the use of Globalize inside spinner and just expose formatting and parsing options where the end user can use Globalize directly (which will be our recommendation). As such, 1.12 will continue to only support Globalize 0.x.