ion-datetime-picker icon indicating copy to clipboard operation
ion-datetime-picker copied to clipboard

disable the date selection

Open sirfghalib opened this issue 8 years ago • 6 comments

is it posible to disbale the date selection something like ng-disabled="true".

sirfghalib avatar Jan 06 '17 05:01 sirfghalib

Hi there, currently it isn't, just use ng-if instead.

What is your use-case for that? Would it be better for you to disable all fields in the picker or disable showing it altogether?

katemihalikova avatar Jan 06 '17 05:01 katemihalikova

my use-case is something like when user is only in view mode then calendar popup should not appear.

sirfghalib avatar Jan 06 '17 05:01 sirfghalib

Thanks, I'll add something for that use case in the next version. For now, just use two ng-ifs or an ng-switch.

katemihalikova avatar Jan 06 '17 05:01 katemihalikova

OK, thanks for your reply, really appreciate that.

sirfghalib avatar Jan 06 '17 05:01 sirfghalib

Oh, I've just remembered that there is a fork that added this functionality to the current version. If you use JahaScript/ion-datetime-picker#0965c69fc0971901f968489cb721f1d0ee294c6a in your package.json or bower.json, you get new attribute read-only, used with boolean value: read-only="isReadOnly" (with $scope.isReadOnly = true; or false;)

katemihalikova avatar Jan 06 '17 08:01 katemihalikova

Thanks @katemihalikova

sirfghalib avatar Jan 09 '17 23:01 sirfghalib