katemihalikova / ion-datetime-picker

Date and/or time picker for awesome Ionic framework
MIT License
169 stars 101 forks source link

disable the date selection #94

Open sirfghalib opened 7 years ago

sirfghalib commented 7 years ago

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

katemihalikova commented 7 years ago

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?

sirfghalib commented 7 years ago

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

katemihalikova commented 7 years ago

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

sirfghalib commented 7 years ago

OK, thanks for your reply, really appreciate that.

katemihalikova commented 7 years ago

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;)

sirfghalib commented 7 years ago

Thanks @katemihalikova