phonegap3-ios-datepicker-plugin icon indicating copy to clipboard operation
phonegap3-ios-datepicker-plugin copied to clipboard

Change datetime value

Open tiendq opened this issue 12 years ago • 5 comments

Hi,

How can I change datetime value after the datepicker control is opened?

Thanks,

tiendq avatar Oct 08 '13 07:10 tiendq

Only an user interaction can change the value of the date picker control (UIDatePicker) if it is opened. But I'm not sure if I understood you correctly...

sectore avatar Oct 08 '13 15:10 sectore

Yes, sadly that it can't be done, thanks.

BTW, you have rewritten this plugin but also removed several things e.g. change event, could you add them back? you know, change event is useful to update input field timely to reflect what user has chosen on the datepicker.

Thanks,

tiendq avatar Oct 09 '13 01:10 tiendq

Could you show me the line of code or documentation of the "original" plugin, where the change event is fired, please? Unfortunately I could not find it.

The "new" plugin displays on an iPhone a cancel and a done button to cancel or save the changes of the selected date by an user activity. Therefore it seems not a good idea to show any changes of the date twice (DatePicker and input field) before an user confirms its changes by pressing the done button. Because the date picker is acting as a layer on top of the application.

Another case on the iPad: Because there are not a cancel and done button any changes of the date will be displayed immediately calling the _dateSelected method on JS side.

Please let me know what you think about it. Thanks!

sectore avatar Oct 11 '13 08:10 sectore

It was not "original" plugin, I'm sorry to make you confused. I was talking about other iOS datepicker plugin, it's here and you can easily see onchange event: https://github.com/radhar/phonegap-ios-datepicker-plugin

IMHO, I think that plugin is more flexible since it allows us to show/hide accessory bar and handle change event. You know, we can often select date and dismiss datepicker by tapping on a field on a view, not by tapping datepicker's cancel/done button.

tiendq avatar Oct 11 '13 15:10 tiendq

I agree! So I will update the plugin to handle change events.

sectore avatar Oct 11 '13 16:10 sectore