Giter Site home page Giter Site logo

skwasjer / skwas-cordova-plugin-datetimepicker Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 38.0 486 KB

Cordova Plugin for showing a native date, time or datetime picker.

License: MIT License

Java 26.77% JavaScript 36.45% Objective-C 35.32% TypeScript 1.46%
android cordova-plugin datepicker datetimepicker ionic-plugin ios phonegap-plugin timepicker

skwas-cordova-plugin-datetimepicker's People

Contributors

angjelkom avatar dependabot[bot] avatar emanfu avatar lemaik avatar masimplo avatar skwasjer avatar sybers avatar turshija avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skwas-cordova-plugin-datetimepicker's Issues

Fullscreen stretched option

What would I need to change to make the actual datepicker stretch? I don't mean the dialog background, I mean to scale the entire dialog to have larger numbers etc.

Buttons Ok and Cancel are invisible (color = background)

Describe the bug
I get some users who have the following problem:
Buttons Ok and Cancel are invisible (color = background)

If they click on the expected location of the bottom, it works.

To Reproduce

The problem occured on a Samsung Galaxy S20 Plus (Android 12) + at least one other device.
The problem don't occurs for the majority of users.

Expected behavior

Button ok and cancel must be visible.

Screenshots
The error:
Screenshot_20220408-083357_Planningify (1)

Expected result:
android12

Cordova
List Cordova versions by running:

  • cordova -v
  • 10.0.0
  • cordova platform ls
  • Installed platforms:
    android 9.1.0

Plugin version
2.1.2

Development OS (please complete the following information):

  • OS: Android

Device (please complete the following information):

  • Device: Samsung Galaxy S20 Plus
  • OS: Android 12

Additional context
Cordova plugin:

Code:
cordova.plugins.DateTimePicker.show({
locale: elemId.includes('breaks') ? 'fr_FR' : null,
titleText: dateTimePickerTitleText,
mode: 'time',
date: theCurrentDate,
cancelText: A.i18n['cancel'],
clearText: showClearButton ? A.i18n['empty'] : null,
okText: 'OK',
android: {
is24HourView: ENV_TIME_24H || elemId.includes('breaks')
},
success: function(newDate) {
...
}
});

When scrolling and clicking done

Describe the bug
I'm on iOS and have both a date and time picker.
Whenever I'm scrolling and clicking done before it's finished, it doesn't return the date, only the old date.
Though, when I open it again, it shows the date that it should have returned, if I click done again, it still returns the old date.

To Reproduce
Click done while it's scrolling in the date/timepicker

Expected behavior
It should return the date that it lands on when finished scrolling

Screenshots
https://share.icloud.com/photos/0DR77e98RBYDP99nGORSm2dPw

Cordova
Cordova version 10

Plugin version
2.1.2

Development OS (please complete the following information):

  • OS: Ubuntu

Device (please complete the following information):

  • Device: iPhone XS Mac
  • OS: 14.0.1

How do I get the time I have selected ?

Hi,

I am using mode = "time" keeping the return value as it is i.e Date.

I want to get the time selected from the picker but it is throwing some error when I convert the date that is returned, into time data type.

Can anyone please me know how do I achieve to get the time selected from picker.

Regards,
Shreyas Bhondve

Date picker layout is not changing when orientation changes in android

Describe the bug
A clear and concise description of what the bug is...

To Reproduce
Steps to reproduce the behavior...

Expected behavior
A clear and concise description of what you expected to happen...

Screenshots
If applicable, add screenshots to help explain your problem...

Cordova
List Cordova versions by running:

  • cordova -v
  • cordova platform ls

Plugin version
The version of this plugin...

Development OS (please complete the following information):

  • OS: [e.g. Windows, Mac]

Device (please complete the following information):

  • Device: [e.g. iPhone6, Samsung S4, Emulator]
  • OS: [e.g. iOS8.1, ..]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

iOS - maxDate bug

Describe the bug
Select time of last date set by maxDate does not work.

To Reproduce
Set mode to datetime.
minDate, maxDate Sets the date.
Time Picker for Last Date Does Not Work

  • It works fine on Android.

Cordova

  • cordova 9.0.0

Plugin version
2.1.1

Development OS (please complete the following information):

  • OS: [Windows, Mac]

Device (please complete the following information):

  • Device: [iPhoneXs]
  • OS: [iOS 13.2]

30 minute offset is added to selected time for different timezone on iOS devices

Hi,

I am using this plugin for time selection purpose. It works perfectly fine on Android devices regardless of any timezone.
But on iOS devices, for some different timezone (in my case facing issue for Malaysia time zone) other GMT+5.30: Indian standard time, picker adds 30 mins offset in selected time.
e.g If i selected 2:00 hrs on iOS devices, it gives 2:30 as selected time.

please help.

Thanks in advance.

Support for promises

Support for promises would allow better integration with frameworks and coding styles that make use of promises.

Requirements

  • Don't break the current API
  • 0 (zero) callback handlers should be registered in both:
    • show(options)
    • show(options, successCallback, errorCallback)
      If this is the case, then we can return a promise from show(options)
  • promise resolve is same as options.success(date). options.cancel() should be supported also by resolving with undefined (no) argument. This behavioral difference must be well documented.
  • promise reject is same as options.error(err)
  • the implementation should be seamless and not break current behavior (when no promise support f.ex. is available or when callbacks are supplied).
  • the plugin will not include a polyfill for Promise, this is a choice the app developer can make for himself
  • ECMA5 compatibility

This is open for anyone to pick up. Improvements to these requirements welcome too.

Error while taking build

I am getting the following error while taking the build

...pathto\platforms\android\src\com\skwas\cordova\datetimepicker\DateTimePicker.java:107: error: strings in switch are not supported in -source 1.6 switch (action) { ^ (use -source 7 or higher to enable strings in switch) Note: Some input files use or override a deprecated API

cordova version :- 7.1.0
cordova android :- 6.1.0

DateTimePickerPlugin: A date/time picker dialog is already showing.

I am loading my date time picture as such:
$("#plan_actual_a_time").siblings('a').on( "click", function(event) { var options = {mode: "time", success: function(newDate) { $('#plan_actual_a_time').val(moment(newDate).format("HH:mm")); retain_arrival_time = newDate; } }; if (retain_arrival_time) { options.date = retain_arrival_time; } cordova.plugins.DateTimePicker.show(options); });

If I click my button then the DT picker shows. I can either dismiss it with the Done or Cancel.

If I click the button again I get the warning "DateTimePickerPlugin: A date/time picker dialog is already showing." in the console log.

What am I doing wrong here?

Plugin doesn't work

Hi, Im trying to use the plugin, I just copied and pasted the example in my project but no window is shown in screen. I just can see this object in the console.

DateTimePickerPlugin: Exec 'show' with: ObjectallowFutureDates: trueallowOldDates: trueandroid: Objectcancel: ()cancelText: "Cancel"date: Tue Aug 27 2019 01:48:41 GMT-0600 (CST)error: (err)locale: "EN"maxDate: nullminDate: Tue Aug 27 2019 01:48:41 GMT-0600 (CST)minDateTicks: 1566892121998minuteInterval: 15mode: "date"okText: "Select"success: (newDate)ticks: 1566892121998__proto__: Object

PLease someone help me !!!!

mode: "time" with allowOldDates: false allows past time

I have:

cordova.plugins.DateTimePicker.show({
	mode: "time",
	date: new Date(),
	allowOldDates: false,
	allowFutureDates: true,
	minuteInterval: 5,
	locale: "EN",
	okText: "Select",
	cancelText: "Cancel",
	android: {
		is24HourView: false
	},
	success: function () {},
	cancel: function () {},
	error: function () {}
});

and I'm able to select a time earlier than now

Support for non-gregorian calendars on iOS

iOS user was experiencing a crash on opening datepicker:

NSRangeException
*** -[__NSArrayM objectAtIndex:]: index 9223372036854775807 beyond bounds [0 .. 1]

On some investigation the likely cause seems to be a non-Gregorian calendar setting (e.g. Buddhist), which changes the year from 2022 to something like 2565 BE

We are using v2.1.2 with a maxDate (which I suspect is causing the range exception)

I understand this is a rare use case, but wondering if there might be a simple fix that doesn't result in a crash

cancel callback not executed on android

hi,
i found that this plugin are amazing, but unfortunately i have some problem with the cancel callback. my code block on cancel never get executed, instead the success callback are called. This problem only occured on "date" mode, and works good on mode "time"

here's my code

cordova.plugins.DateTimePicker.show({
mode: "date",
date: myDate,
allowOldDates: true,
allowFutureDates: false,
minuteInterval: 1,
locale: "EN",
okText: "Ok",
cancelText: "Cancel",
android: {
theme: 16974126, // Theme_DeviceDefault_Dialog
calendar: false,
is24HourView: false
},
success: function (newDate) {
var rslt = newDate.getDate() + '/' + (newDate.getMonth() + 1) + '/' + newDate.getFullYear() + " ";
target.val(rslt);
myDate = newDate;
},
cancel: function () {
// just do nothing
alert("cancel"); // it's not called
},
error: function (err) {
alert("error");
}
});

Feature Request - Year in Date/Time for ISO 14

This might just be a question vs a feature request. Is there a way to have the year available when using the date/time picker under iSO 14x? I get month, day and time, but I would also like the user to be able to select the year.

iOS show nothing when skipped some options

It said "Note that not all options have to be set" but when I skipped
allowOldDates, allowFutureDates, okText or cancelText anyone of them, it will throw:

-[NSNull length]: unrecognized selector sent to instance 0x10ec....
at

- (void)configureDatePicker:(NSMutableDictionary *)optionsOrNil datePicker:(UIDatePicker *)datePicker;
{
...
BOOL allowOldDates = [[optionsOrNil objectForKey:@"allowOldDates"] intValue] == 1 ? YES : NO;
BOOL allowFutureDates = [[optionsOrNil objectForKey:@"allowFutureDates"] intValue] == 1 ? YES : NO;
...
if (okTextString == nil || okTextString.length == 0) okTextString = @"Select";
if (cancelTextString == nil || cancelTextString.length == 0) cancelTextString = @"Cancel";

but no problem after assigned values (like example) to them!
I am not an iOS programmer so I don't know why or is this a bug or not (maybe my Cordova integrity)

P.S. I am using XCode 9.4.1 run in iPhone8 (11.4) emulator + Cordova 8.0.0 w/ cordova-ios 4.5.4

IOS 11.1.1 update fails to display, no errors

Previously was working beautifully - using Angular inside Cordova...

(window).cordova.plugins.DateTimePicker.show({
mode: 'datetime',
date: myDate,
allowOldDates: true,
allowFutureDates: true,
minuteInterval: 15,
locale: 'EN',
okText: 'Select',
cancelText: 'Cancel',
android: {
theme: 16974126, // Theme_DeviceDefault_Dialog
calendar: true,
is24HourView: true
},
success: function(newDate) {...

Since IOS update, now fails silently.

Cannot build after enabling AndroidX in config.xml

Describe the bug
When I add <preference name="AndroidXEnabled" value="true" /> in config.xml, the project doesn't build in Android Studio with the following error message:

/Users/USER/Documents/Projekte/APPNAME/App/APPNAME/platforms/android/app/src/main/java/com/skwas/cordova/datetimepicker/TimePickerDialog.java:7: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;

AndroidX was recently added with Cordova Android 9.0.0:
https://cordova.apache.org/announcements/2020/06/29/cordova-android-9.0.0.html

  • cordova -v 10.0.0
  • cordova platform ls android 9.0.0
  • skwas-cordova-plugin-datetimepicker 2.1.1 "DateTime picker"
  • OS: macOS X

Unable to build with [email protected]

Describe the bug
When I try to build my project using Cordova I receive and error and the following stack trace

BUILD FAILED in 2s
27 actionable tasks: 3 executed, 24 up-to-date
/Users/chadedwards/git/fergus_mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
/Users/chadedwards/git/fergus_mobile/platforms/android/src/com/skwas/cordova/datetimepicker/DateTimePicker.java:306: error: local variable callbackContext is accessed from within inner class; needs to be declared final
					callbackContext.success(new JSONObject());

To Reproduce

cordova plugin add skwas-cordova-plugin-datetimepicker
cordova build android

Expected behavior
Build success

Screenshots
Not applicable

Cordova
List Cordova versions by running:

Development OS (please complete the following information):

  • Mac Mojave

Device (please complete the following information):
Build error not runtime error

Additional context

minuteInterval does not seem to be working

Describe the bug
While recognized as a parameter, minuteInterval does not seem to be recognized. You can still select any minute available.

To Reproduce
Simply installing the plugin and using minuteInterval

Expected behavior
Minutes should only be selectable by their interval. Any other option should simply not be an option

Cordova
List Cordova versions by running:

  • cordova -v 12.0.0
  • cordova platform ls android 12.0.1

Plugin version
Most recent

Development OS (please complete the following information):

  • OS: Windows

Device (please complete the following information):

  • Device: Android Emulated Phone/Tablet

Additional context
Creating a new time picker also throws this error every time and takes a bit longer than to be expected:

java.lang.NoSuchFieldException: timePicker
	at java.lang.Class.getField(Class.java:1635)
	at com.skwas.cordova.datetimepicker.TimePickerDialog.onCreate(TimePickerDialog.java:90)
	at android.app.Dialog.dispatchOnCreate(Dialog.java:432)
	at android.app.Dialog.show(Dialog.java:321)
	at android.app.TimePickerDialog.show(TimePickerDialog.java:151)
	at com.skwas.cordova.datetimepicker.DateTimePicker.showDialog(DateTimePicker.java:293)
	at com.skwas.cordova.datetimepicker.DateTimePicker.access$400(DateTimePicker.java:28)
	at com.skwas.cordova.datetimepicker.DateTimePicker$1.run(DateTimePicker.java:231)
	[...]

Phonegap Build - iOS issue

Describe the bug
When using PGB I get a Build-Error for iOS. In the error log it says:

In file included from /project/myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.m:1:
/project/myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.h:14:52: warning: this block declaration is not a prototype [-Wstrict-prototypes]
@Property (nonatomic, strong) void (^cancelHandler)();
^
void
/project/myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.m:182:42: error: no known class method for selector 'linkColor'
lightButtonLabelColor = [UIColor linkColor];
^~~~~~~~~
/project/myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.m:183:41: error: no known class method for selector 'labelColor'
darkButtonLabelColor = [UIColor labelColor];
^~~~~~~~~~
/project/myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.m:185:42: error: no known class method for selector 'systemBlueColor'
lightButtonLabelColor = [UIColor systemBlueColor];
^~~~~~~~~~~~~~~
1 warning and 3 errors generated.

The final message is:

_The following build commands failed:
CompileC /Library/Developer/Xcode/DerivedData/myApp-bmmughqmovduvjaubxzkotytxccb/Build/Intermediates.noindex/ArchiveIntermediates/myApp/IntermediateBuildFilesPath/myApp.build/Release-iphoneos/myApp.build/Objects-normal/armv7/ModalPickerViewController.o myApp/Plugins/skwas-cordova-plugin-datetimepicker/ModalPickerViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: xcodebuild: Command failed with exit code 65
at ChildProcess.whenDone (/private/project/cordova/node_modules/cordova-common/src/superspawn.js:135:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess.handle.onexit (internal/child_process.js:251:5)

To Reproduce
Include Plugin in iOS-Project and hit Build.

Cordova
List Cordova versions by running:

  • PGB / cli-9.0.0 (5.0.1 / 8.0.0 / 7.0.0)

Plugin version
Tested with 2.1.1

Development OS (please complete the following information):

  • OS: Mac

Additional context
About a month ago the error was not present - using the same components listed above

Android 9, works properly but fails when TalkBack is active

So, as I mentioned, the plugin works fine, the only problem that I have is that when using Android 9 with TalkBack active it simply does not open the component, once I disable TalkBack it works fine.

I have no errors in chrome inspector, I didn't check native Android logs.

Issue with IOS date time picker value automatically reset to the current date time

angular.module('Locations', [])
.controller('MyLocactionController', function($scope, $location) {

    $scope.startTs = new Date();
    $scope.startTs.setHours(0,0,0,0);
    $scope.endTs = new Date();
    $scope.endTs.setHours(23,59,59,59); 

    $scope.startTsdatePicker = function() {

        cordova.plugins.DateTimePicker.show({
            mode: "datetime",
            date: $scope.startTs,
            allowOldDates: true,
            allowFutureDates: false,
            // minuteInterval: 15,
            locale: "EN",
            okText: "Select",
            cancelText: "Cancel",
            android: {
                // theme: 16974126, // Theme_DeviceDefault_Dialog 
                calendar: false,
                is24HourView: false
            },
            success: function(newDate) {
                console.log('Date Updated')
                console.log($scope.startTs)
                $scope.startTs = newDate;
                $scope.$apply();
                console.log($scope.startTs)
            },
            cancel: function() {

                console.log('Date canceled')
                alert("Canceled");
            },
            error: function(err) {
                console.log('we got some error')
                alert(err);
            }
        });
    }

    $scope.endTsdatePicker = function() {

        cordova.plugins.DateTimePicker.show({
            mode: "datetime",
            date: $scope.endTs,
            allowOldDates: true,
            allowFutureDates: false,
            // minuteInterval: 15,
            locale: "EN",
            okText: "Select",
            cancelText: "Cancel",
            android: {
                theme: 16974126, // Theme_DeviceDefault_Dialog 
                calendar: false,
                is24HourView: false
            },
            success: function(newDate) {
                $scope.endTs = newDate;
                $scope.$apply();
            },
            cancel: function() {
                alert("Cancelled");
            },
            error: function(err) {
                alert(err);
            }
        });
    }


});

In IOS its fallback to current date time.

Failed to install

Describe the bug

I can't install the plugin 
Failed to install 'skwas-cordova-plugin-datetimepicker': CordovaError: Failed to instantiate ProjectBuilder builder: Error: Cannot find module 'compare-func'
Require stack:
- /Users/Andy/mobile-apps/wpchurch-2022/platforms/android/cordova/lib/builders/ProjectBuilder.js
- /Users/Andy/mobile-apps/wpchurch-2022/platforms/android/cordova/lib/builders/builders.js
- /Users/Andy/mobile-apps/wpchurch-2022/platforms/android/cordova/Api.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/index.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/plugman.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/cordova-lib.js
- /usr/local/lib/node_modules/cordova/src/help.js
- /usr/local/lib/node_modules/cordova/src/cli.js
- /usr/local/lib/node_modules/cordova/bin/cordova
    at Object.module.exports.getBuilder (/Users/Andy/mobile-apps/wpchurch-2022/platforms/android/cordova/lib/builders/builders.js:32:15)
    at Api.<anonymous> (/Users/Andy/mobile-apps/wpchurch-2022/platforms/android/cordova/Api.js:215:44)
    at _fulfilled (/Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:854:54)
    at /Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:816:13)
    at /Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:570:49
    at runSingle (/Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:137:13)
    at flush (/Users/Andy/mobile-apps/wpchurch-2022/node_modules/q/q.js:125:13)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

To Reproduce
cordova plugin add skwas-cordova-plugin-datetimepicker

Expected behavior
Normal install

Cordova
List Cordova versions by running:
Cordova version: 10.0.0 ([email protected])

Installed platforms:
android 8.1.0
browser 5.0.0
ios 6.2.0

Plugin version
3.0.1

Development OS (please complete the following information):
Mac

Crashing On IOS - Add support for min and max date

cordova.plugins.DateTimePicker.show({
maxDate: null,
})

src/ios/DateTimePicker.m
long long maxDate = [[optionsOrNil objectForKey:@"maxDate"] longLongValue];

The above line is causing an exception for converting null value to longLongValue.

[iOS] inferior UX since iOS 14

Since iOS 14, the design of the iOS picker has changed to an imho inferior UX. It adds another two clicks to the process.

It used to be:

  1. Swipe to change the time
  2. Accept

IMG_2275

And now it's:

  1. Click on time
  2. Swipe to change the time (which is much more difficult, since the touchable area is significantly smaller)
  3. Click to dismiss the calendar view
  4. Accept

IMG_2276
IMG_2277

Is there any chance we could go back to the old design or choose which one to use? :)

My system
iOS 14.0.1
skwas-cordova-plugin-datetimepicker 2.1.1
cordova -v 10.0.0
cordova ios 6.1.0

Time Display mode shows entire date, not just time - iOS

Describe the bug
With display mode set to Time, full date and time show

To Reproduce
Set mode to Time
Expected behavior
Only Time should show

Screenshots

Screen Shot 2020-01-28 at 2 37 07 PM

Here is my Code: $(document).on('click', '.timepicker', function(event) { $(this).each(function(index) { var now = new Date(); var today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); var currentField = $(this); var myNewDate = Date.parse(currentField.val()) || new Date();
            // Same handling for iPhone and Android
            cordova.plugins.DateTimePicker.show({
            mode: "time",
            date: now,
            allowOldDates: true,
            allowFutureDates: true,
            minDate: null,
            maxDate: null,
            minuteInterval: 15,
            locale: "EN",
            okText: "Select",
            cancelText: "Cancel",
            android: {
                theme:16974126, // Theme_DeviceDefault_Dialog
                is24HourView: true
            },
            success: function(returnDate) {
                var newDate = new Date(returnDate);
                currentField.val(newDate.toString("HH:mm"));

                // This fixes the problem you mention at the bottom of this script with it not working a second/third time around, because it is in focus.
                currentField.blur();
            },

cancel: function() {
console.info("Cancelled");
},
error: function(err) {
// Handle error.
console.error(err);
}
});
});
});

Cordova
List Cordova versions by running:

  • cordova -v 9
  • cordova platform iOS v5.1.1

Plugin version
Current

Development OS (please complete the following information):

  • OS: [iOS]

Device (please complete the following information):

  • Device: [iPhone X]
  • OS: [13.3]

App crashes when passing a date instantiated with time in the PM

My use case is setting a time range of n hours, and the start time starts at the next hour. The end range needs to respect the current meridian, e.g. it's 8:15AM so the display would show 9AM - 1PM. Trying to set 13:00 on a JavaScript date works, but when passed to options.date, my app crashes. How can I help debug this further?

Android opnes just date picker in datetime mode

I am trying to use this plugin to both date and time picker.
But only the date picker opening.

my code:

var showDatePicker = function () {
            var deferred = $q.defer();

            document.addEventListener("deviceready", function () {
                cordova.plugins.DateTimePicker.show({
                    mode: "datetime",
                    date: new Date(),
                    allowOldDates: false,
                    allowFutureDates: true,
                    minuteInterval: 15,
                    locale: "EN",
                    okText: "OK",
                    cancelText: "Cancel"
                }, function(newDate) {
                    deferred.resolve(newDate);
                    }, function (err) {
                        // Handle error.
                        console.error(err);
                    });
            }, false);

   return deferred.promise;
        }

Thanks..

Default background color on iOS light theme is wrong

Describe the bug
After the latest update of the plugin, the color of the Datepicker on iOS (light theme) changed from white to light gray. Is this on purpose?

Expected behavior
The default light theme background color should be white (?)

Plugin version
v2.1.0

Device (please complete the following information):

  • Device: iPhone
  • OS: iOS 13.2

Time picker is not working fine

Hi
Time picker is not working while second time initiate. I got date and time picker in a page. If I initiate the date picker first, Time picker will show 4:30 pm and I cant select time in AM.

 $scope.setTime = function (type,) {
                    var datepicker_options={
        mode: "time",
        date: new Date(),
        allowOldDates: true,
        allowFutureDates: true,
        minuteInterval: 15,
        locale: "EN",
        okText: "Select",
        cancelText: "Cancel",
        android: {
            theme: 16974126, // Theme_DeviceDefault_Dialog 
            calendar: false,
            is24HourView: true
        },
        success: $scope.selectValidity,
        cancel: $scope.cancelValidity,
        error: function (err) {console.error(err); }
    }
                      $scope.date_type = type;
                cordova.plugins.DateTimePicker.show(datepicker_options);
                };
                $scope.setDate = function (type,dateformat) {
                    var datepicker_options={
        mode: "date",
        date: new Date(),
        allowOldDates: false,
        allowFutureDates: true,
        minuteInterval: 15,
        locale: "EN",
        okText: "Select",
        cancelText: "Cancel",
        android: {
            theme: 16974126, // Theme_DeviceDefault_Dialog 
            calendar: false,
            is24HourView: true
        },
        success: $scope.selectValidity,
        cancel: $scope.cancelValidity,
        error: function (err) {console.error(err); }
    }
                    $scope.date_type = type;
                cordova.plugins.DateTimePicker.show(datepicker_options);
                };
<input class="text-input" name="date" placeholder="MM/DD/YYYY" ng-click="setDate('date')" ng-model="quote_form.date" required="" style="width: 100%;"/>
<input class="text-input" name="date" placeholder="MM/DD/YYYY" ng-click="setTime('time')" ng-model="quote_form.date" required="" style="width: 100%;"/>

Cordova build for Android failing

Hello,
after adding this plugin, my Android building is failing.
We are using command line build: cordova android build, and getting this output:

/Users/User/Dropbox/web/cordova/project/platforms/android/src/com/skwas/cordova/datetimepicker/DateTimePicker.java:26: error: package javax.annotation does not exist
import javax.annotation.Nonnull;
                       ^
/Users/User/Dropbox/web/cordova/project/platforms/android/src/com/skwas/cordova/datetimepicker/DateTimePicker.java:36: error: cannot find symbol
        @Nonnull
         ^
  symbol:   class Nonnull
  location: class DateTimePicker.DateTimePickerOptions
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.697 secs
Error: /Users/User/Dropbox/web/cordova/project/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/User/Dropbox/web/cordova/project/platforms/android/src/com/skwas/cordova/datetimepicker/DateTimePicker.java:26: error: package javax.annotation does not exist
import javax.annotation.Nonnull;
                       ^
/Users/User/Dropbox/web/cordova/project/platforms/android/src/com/skwas/cordova/datetimepicker/DateTimePicker.java:36: error: cannot find symbol
        @Nonnull
         ^
  symbol:   class Nonnull
  location: class DateTimePicker.DateTimePickerOptions
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Any ideas ?

ANDROID_HOME=/Users/User/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

Cordova version 6.5.0
Installed platforms:
android 6.2.0-dev
browser 4.1.0
ios 4.3.1

iOS is working without any problems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.