Skip to content

Commit 6142428

Browse files
committed
Update
Globalization interface updated
1 parent d06f2d2 commit 6142428

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionic-native-mocks",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"description":
55
"Mocks for Ionic Native for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
66
"author":

src/@ionic-native-mocks/plugins/globalization/index.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Globalization } from '@ionic-native/globalization';
22

3+
export interface GlobalizationOptions {
4+
formatLength: string;
5+
selector: string;
6+
}
7+
38
export class GlobalizationMock extends Globalization {
49
/**
510
* Returns the BCP-47 compliant language identifier tag to the successCallback with a properties object as a parameter. That object should have a value property with a String value.
@@ -59,22 +64,21 @@ export class GlobalizationMock extends Globalization {
5964
/**
6065
* Returns a pattern string to format and parse dates according to the client's user preferences.
6166
* @param options Object with the format length and selector
62-
* @returns {Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }>} Returns a promise.
67+
* @returns {Promise<{ pattern: string, timezone: string, iana_timezone: string, utc_offset: number, dst_offset: number }>} Returns a promise.
6368
*/
64-
getDatePattern(options: {
65-
formatLength: string;
66-
selector: string;
67-
}): Promise<{
69+
getDatePattern(options: GlobalizationOptions): Promise<{
6870
pattern: string;
6971
timezone: string;
70-
utf_offset: number;
72+
iana_timezone: string;
73+
utc_offset: number;
7174
dst_offset: number;
7275
}> {
73-
let theResult: { pattern: string, timezone: string, utf_offset: number, dst_offset: number } = { pattern: '', timezone: '', utf_offset: 0, dst_offset: 0 };
76+
let theResult: { pattern: string, timezone: string, iana_timezone: string, utc_offset: number, dst_offset: number } = { pattern: '', timezone: '', iana_timezone: '', utc_offset: 0, dst_offset: 0 };
7477
return new Promise((resolve, reject) => {
7578
resolve(theResult);
7679
});
7780
};
81+
7882
/**
7983
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
8084
* @param options Object with type (narrow or wide) and item (month or days).

0 commit comments

Comments
 (0)