Socket
Socket
Sign inDemoInstall

nativescript-sdk-utility

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nativescript-sdk-utility

This plugin is a collection of utilities for iOS and Android to simplify your NativeScript apps.


Version published
Maintainers
1
Created

Readme

Source

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

Keywords

FAQs

Last updated on 21 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc