nativescript-timedatepicker icon indicating copy to clipboard operation
nativescript-timedatepicker copied to clipboard

Feature request How about: Modify showDateTimePickerDialog() to also work on Android?

Open creambyemute opened this issue 8 years ago • 2 comments

Hey,

I was just wondering wouldn't it be better to make 'showDateTimePickerDialog()' also work on Android so that it opens the TimePickerDialog after selecting a date?

Isn't that be the purpose of a plugin, to abstract those calls so you don't have to differentiate in the actual app whether it's iOS/Android or not?

Cheers,

creambyemute avatar Oct 18 '16 16:10 creambyemute

Well the thing is that the plugin is limited to the native libs, on ios there is a method that show date and time on the same screen. But I understand your point, the code to do what you want is part of the demo

  var mCallback2 = function (result) {
        if (result) {
             alert("the result is "+result);
        }
    };

    var mCallback = function (result) {
        if (result) {
           PickerManager.registerCallback(mCallback2);
           PickerManager.showTimePickerDialog();
        }
    };

    PickerManager.init(mCallback,null,null);

    var minDate = new Date(2014, 12, 1, 12, 00, 00, 00);
    PickerManager.setMinDate(minDate);

    var maxDate = new Date(2016, 12, 1, 12, 00, 00, 00);
    PickerManager.setMaxDate(maxDate);

    PickerManager.showDatePickerDialog();

I will add it whenever I have time as part of the plugin (but mind that I am super busy with other projects and will take time) You can speed it up test that all is good and create a pull, everyone using this plugin will thank you :-)

AntonioCuevaUrraco avatar Oct 20 '16 06:10 AntonioCuevaUrraco

I'll check at the weekend, I actually did the same in my app now (+ the calls for the iOS DateTimePicker when it's iOS)

creambyemute avatar Oct 20 '16 07:10 creambyemute