1.0.9 • Published 6 years ago

nativescript-sdk-utility v1.0.9

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
6 years ago

NativeScript SDK Utility

This plugin provides device specific functions that simplify your NativeScript apps.

  • getVersion(): Returns the current version of your app.
  • getBuild(): Returns the current build of your app.
  • is24HFormat(): Returns a boolean value that indicates if the device is using a 24H time format.
  • formatDateTime(date?: Date, pattern?: string, locale?: string): Returns a date based on given pattern.

Installation

tns plugin add nativescript-sdk-utility

Usage

```JavaScript
var utility = require('nativescript-sdk-utility');

var sdk = new utility.SDKUtility();

var version = sdk.getVersion();
var build = sdk.getBuild();
var is24H = sdk.is24HFormat();
var datetime = this.sdk.formatDateTime(new Date(), "MM/dd/yyyy h:mm");
```)

```TypeScript
import { SDKUtility } from 'nativescript-sdk-utility';

export class MyModel {
    public version: string;
    public build: string;
    public is24H: boolean;

    private sdk: SDKUtility;

    constructor() {
        super();

        this.sdk = new SDKUtility();
        this.version = this.sdk.getVersion();
        this.build = this.sdk.getBuild();
        this.is24H = this.sdk.is24HFormat();
        this.datetime = this.sdk.formatDateTime(new Date(), "MM/dd/yyyy h:mm");
    }
}
```

License

Apache License Version 2.0, January 2004

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago