1
- import defModule = require ( "nativescript- intl") ;
1
+ import * as Intl from "./ intl";
2
2
3
3
export var NUMERIC = 'numeric' ;
4
4
export var LONG = 'long' ;
5
5
export var SHORT = 'short' ;
6
6
export var TWODIGIT = '2-digit' ;
7
7
export var FULL = 'full' ;
8
8
9
- export class DateTimeFormat implements defModule . DateTimeFormat {
10
- constructor ( private locale ?: string , private options ?: defModule . DateTimeFormatOptions , private pattern ?: string ) {
9
+ export class DateTimeFormat implements Intl . DateTimeFormat {
10
+ constructor ( private locale ?: string , private options ?: Intl . DateTimeFormatOptions , private pattern ?: string ) {
11
11
if ( options && options . minute === NUMERIC ) {
12
12
this . options . minute = TWODIGIT ;
13
13
}
@@ -16,11 +16,11 @@ export class DateTimeFormat implements defModule.DateTimeFormat {
16
16
}
17
17
}
18
18
19
- private hasTimeOptions ( options : defModule . DateTimeFormatOptions ) : boolean {
19
+ private hasTimeOptions ( options : Intl . DateTimeFormatOptions ) : boolean {
20
20
return options . hour !== undefined || options . minute !== undefined || options . second !== undefined ;
21
21
}
22
22
23
- private hasDateOptions ( options : defModule . DateTimeFormatOptions ) : boolean {
23
+ private hasDateOptions ( options : Intl . DateTimeFormatOptions ) : boolean {
24
24
return options . weekday !== undefined || options . year !== undefined || options . month !== undefined || options . day !== undefined ;
25
25
}
26
26
@@ -204,14 +204,14 @@ export class DateTimeFormat implements defModule.DateTimeFormat {
204
204
}
205
205
}
206
206
207
- export class NumberFormat implements defModule . NumberFormat {
208
- constructor ( private locale ?: string , private options ?: defModule . NumberFormatOptions , private pattern ?: string ) { }
207
+ export class NumberFormat implements Intl . NumberFormat {
208
+ constructor ( private locale ?: string , private options ?: Intl . NumberFormatOptions , private pattern ?: string ) { }
209
209
210
- public formatNative ( value : number , locale ?: string , options ?: defModule . NumberFormatOptions , pattern ?: string ) : string {
210
+ public formatNative ( value : number , locale ?: string , options ?: Intl . NumberFormatOptions , pattern ?: string ) : string {
211
211
return '' ;
212
212
}
213
213
214
214
public format ( value : number ) {
215
215
return this . formatNative ( value , this . locale , this . options , this . pattern ) ;
216
216
}
217
- }
217
+ }
0 commit comments