UNPKG

2.29 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Date Picker
11 * @description
12 * The DatePicker plugin allows the user to fetch date or time using native dialogs.
13 *
14 * @usage
15 * ```typescript
16 * import { DatePicker } from 'ionic-native';
17 *
18 *
19 * DatePicker.show({
20 * date: new Date(),
21 * mode: 'date'
22 * }).then(
23 * date => console.log('Got date: ', date),
24 * err => console.log('Error occurred while getting date: ', err)
25 * );
26 * ```
27 * @interfaces
28 * DatePickerOptions
29 */
30var DatePicker = (function () {
31 function DatePicker() {
32 }
33 /**
34 * Shows the date and/or time picker dialog(s)
35 * @param {DatePickerOptions} options Options for the date picker.
36 * @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
37 */
38 DatePicker.show = function (options) {
39 return;
40 };
41 /**
42 * @private
43 */
44 DatePicker.ANDROID_THEMES = {
45 THEME_TRADITIONAL: 1,
46 THEME_HOLO_DARK: 2,
47 THEME_HOLO_LIGHT: 3,
48 THEME_DEVICE_DEFAULT_DARK: 4,
49 THEME_DEVICE_DEFAULT_LIGHT: 5
50 };
51 __decorate([
52 plugin_1.Cordova()
53 ], DatePicker, "show", null);
54 DatePicker = __decorate([
55 plugin_1.Plugin({
56 pluginName: 'DatePicker',
57 plugin: 'cordova-plugin-datepicker',
58 pluginRef: 'datePicker',
59 repo: 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker',
60 platforms: ['Android', 'iOS', 'Windows']
61 })
62 ], DatePicker);
63 return DatePicker;
64}());
65exports.DatePicker = DatePicker;
66//# sourceMappingURL=datepicker.js.map
\No newline at end of file