File tree Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,7 @@ var monthNameStrategies = {
132
132
return monthNameStrategies . standalone ( monthIndex , monthFormat ) ;
133
133
}
134
134
} ;
135
-
136
- dateLocalization . resetInjection ( ) ;
137
- dateLocalization . inject ( {
135
+ var intlDateLocalization = {
138
136
getMonthNames : function ( format , type ) {
139
137
var intlFormats = {
140
138
wide : 'long' ,
@@ -331,4 +329,17 @@ dateLocalization.inject({
331
329
332
330
return index === undefined ? 1 : index ;
333
331
}
334
- } ) ;
332
+ } ;
333
+
334
+ var intlIsEmbedded = compareVersions ( dxVersion , '19.2.1' ) > - 1 ;
335
+ var intlIsActive = dateLocalization . engine && dateLocalization . engine ( ) === 'intl' ;
336
+
337
+ if ( ! intlIsEmbedded || ! intlIsActive ) {
338
+ dateLocalization . resetInjection ( ) ;
339
+ dateLocalization . inject ( intlDateLocalization ) ;
340
+
341
+ if ( intlIsEmbedded ) {
342
+ // eslint-disable-next-line no-console
343
+ console . log ( 'Since v19.2, Intl localization utilities are included in DevExtreme. Do not use the separate devextreme-intl module.' ) ;
344
+ }
345
+ }
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ var currencyOptionsCache = {},
20
20
return ( new Intl . NumberFormat ( locale ( ) , { style : 'currency' , currency : currency } ) ) ;
21
21
} ;
22
22
23
- numberLocalization . resetInjection ( ) ;
24
- numberLocalization . inject ( {
23
+ var intlNumberLocalization = {
25
24
_formatNumberCore : function ( value , format , formatConfig ) {
26
25
if ( format === 'exponential' ) {
27
26
return this . callBase . apply ( this , arguments ) ;
@@ -189,4 +188,17 @@ numberLocalization.inject({
189
188
options = this . _getCurrencyOptions ( currencyValue ) ;
190
189
return this . _createOpenXmlCurrencyFormat ( options ) ;
191
190
}
192
- } ) ;
191
+ } ;
192
+
193
+ var intlIsEmbedded = compareVersions ( dxVersion , '19.2.1' ) > - 1 ;
194
+ var intlIsActive = numberLocalization . engine && numberLocalization . engine ( ) === 'intl' ;
195
+
196
+ if ( ! intlIsEmbedded || ! intlIsActive ) {
197
+ if ( intlIsEmbedded ) {
198
+ // eslint-disable-next-line no-console
199
+ console . log ( 'Since v19.2, Intl localization utilities are included in DevExtreme. Do not use the separate devextreme-intl module.' ) ;
200
+ }
201
+
202
+ numberLocalization . resetInjection ( ) ;
203
+ numberLocalization . inject ( intlNumberLocalization ) ;
204
+ }
You can’t perform that action at this time.
0 commit comments