huehnerhose / nativescript-timedatepicker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nativescript-timedatepicker

A NativeScript plugin providing native date and time pickers for Android and iOS.

##Android side alt tag ##iOS side alt tag

Usage

//Require it
var PickerManager= require("nativescript-timedatepicker");
//Create a callback function
var mCallback = function (result) {
  if (result) {
    alert("the time is "+result);
  }
};
//Initialize the PickerManager (.init(yourCallback, title, initialDate))
PickerManager.init(mCallback,null,null);
//Show the dialog
PickerManager.showTimePickerDialog();
//If you want to convert the string into a js Date I recomend to use moment.js
  var scheduleMoment = moment(result, "DD MM YYYY HH:mm z");
  var scheduleDate = scheduleMoment.toDate();

For more examples of usage see the demo main-view-model.ts.

##Credits This plugin abstract two native libraries, hence here are the project and deserved merit to the creators.

For iOS https://github.com/hackiftekhar/IQActionSheetPickerView
For Android https://github.com/CiTuX/datetimepicker

About


Languages

Language:JavaScript 56.4%Language:TypeScript 42.0%Language:CSS 1.1%Language:Ruby 0.5%