https://github.com/shiv19/nativescript-material-datetimepicker
Material Design Datetimepicker for Nativescript
https://github.com/shiv19/nativescript-material-datetimepicker
datetimepicker material nativescript picker
Last synced: 8 months ago
JSON representation
Material Design Datetimepicker for Nativescript
- Host: GitHub
- URL: https://github.com/shiv19/nativescript-material-datetimepicker
- Owner: shiv19
- License: apache-2.0
- Created: 2017-10-14T13:57:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T22:10:10.000Z (about 8 years ago)
- Last Synced: 2025-03-31T12:58:04.743Z (9 months ago)
- Topics: datetimepicker, material, nativescript, picker
- Language: TypeScript
- Size: 1.95 MB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nativescript-material-datetimepicker [](https://travis-ci.org/shiv19/nativescript-material-datetimepicker) [](https://www.npmjs.com/package/nativescript-material-datetimepicker) [](https://www.npmjs.com/package/nativescript-material-datetimepicker)
[](https://twitter.com/MultiShiv19)
[](https://nodei.co/npm/nativescript-material-datetimepicker/)
This plugin is a wrapper around `android.app.DatePickerDialog` for Android.
---
## DEPRECATED - 25th Oct 2017
All functionality of this plugin, and more (including iOS Support), is now
available at [nativescript-modal-datetimepicker](https://www.npmjs.com/package/nativescript-modal-datetimepicker) <3
Use this plugin, only if you don't need iOS support, and other additional features.
Be warned, development of this plugin has been discontinued.
- Shiv19
---
## Screenshots
### Date Picker
### Time Picker
## Installation
```javascript
tns plugin add nativescript-material-datetimepicker
```
## Usage
NativeScript Core
```js
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 is: " + result.hour + ":" + result.minute);
})
.catch((error) => {
console.log("Error: " + error);
});
};
```
## API
`pickDate(): Promise<{}>;`
Returns a promise that resolves to date object
```js
date: {
day: number,
month: number,
year: number
}
```
`pickTime(is24HourView?): Promise<{}>;`
Returns a promise that resolves to time object
```js
time: {
hour: number,
minute: number
}
```
Passing `true` to this API, shows a 24hr View timepicker.
## License
Apache License Version 2.0, January 2004