🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

nativescript-material-datetimepicker

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-material-datetimepicker

NativeScript Plugin to use Material Design Date and Time Picker

Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
13
-18.75%
Maintainers
1
Weekly downloads
 
Created
Source

nativescript-material-datetimepicker

This plugin is a wrapper around android.app.DatePickerDialog for Android. It is not compatible with iOS yet.

Screenshots

Date Picker Time Picker

Installation

tns plugin add nativescript-material-datetimepicker

Usage

NativeScript Core


const MDTPicker = require("nativescript-material-datetimepicker").MaterialDatetimepicker;

const mDtpicker = new MDTPicker();

// Pick Date
exports.selectDate = function() {
    mDtpicker.pickDate()
        .then((result) => {
            console.log("Date is: " + result.day + "-" + result.month + "-" + result.year);
        })
        .catch((error) => {
            console.log("Error: " + error);
        });
};

// Pick Time
exports.selectTime = function() {
    mDtpicker.pickTime()
        .then((result) => {
            console.log("time", "Time is: " + result.hour + ":" + result.minute);
        })
        .catch((error) => {
            console.log("Error: " + error);
        });
};

API

pickDate(): Promise<{}>;

Returns a promise that resolves to date object date: { day: number, month: number, year: number }

pickTime(is24HourView?): Promise<{}>;

Returns a promise that resolves to time object time: { hour: number, minute: number }

Passing true to this API, shows a 24hr View timepicker.

License

Apache License Version 2.0, January 2004

Keywords

NativeScript

FAQs

Package last updated on 14 Oct 2017

Did you know?

Socket

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