Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Globalization interface updated
  • Loading branch information
chrisgriffith committed May 30, 2018
1 parent d06f2d2 commit 6142428
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic-native-mocks",
"version": "2.0.9",
"version": "2.0.10",
"description":
"Mocks for Ionic Native for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"author":
Expand Down
18 changes: 11 additions & 7 deletions src/@ionic-native-mocks/plugins/globalization/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Globalization } from '@ionic-native/globalization';

export interface GlobalizationOptions {
formatLength: string;
selector: string;
}

export class GlobalizationMock extends Globalization {
/**
* 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.
Expand Down Expand Up @@ -59,22 +64,21 @@ export class GlobalizationMock extends Globalization {
/**
* Returns a pattern string to format and parse dates according to the client's user preferences.
* @param options Object with the format length and selector
* @returns {Promise<{ pattern: string, timezone: string, utf_offset: number, dst_offset: number }>} Returns a promise.
* @returns {Promise<{ pattern: string, timezone: string, iana_timezone: string, utc_offset: number, dst_offset: number }>} Returns a promise.
*/
getDatePattern(options: {
formatLength: string;
selector: string;
}): Promise<{
getDatePattern(options: GlobalizationOptions): Promise<{
pattern: string;
timezone: string;
utf_offset: number;
iana_timezone: string;
utc_offset: number;
dst_offset: number;
}> {
let theResult: { pattern: string, timezone: string, utf_offset: number, dst_offset: number } = { pattern: '', timezone: '', utf_offset: 0, dst_offset: 0 };
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 };
return new Promise((resolve, reject) => {
resolve(theResult);
});
};

/**
* Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar.
* @param options Object with type (narrow or wide) and item (month or days).
Expand Down

0 comments on commit 6142428

Please sign in to comment.