react-bootstrap-datetimepicker icon indicating copy to clipboard operation
react-bootstrap-datetimepicker copied to clipboard

Adding possibility to clear the selector and the properties clearable, disabled and placeholder.

Open alex1712 opened this issue 9 years ago • 3 comments

Hello again,

I did some changes which I needed in my current project and hope that could help you to keep improving :).

Here a resume of the changes:

  • Added the property 'value' as now it is possible that the selector doesn't have any value at the beginning or that the developar want to change the value fro outside the selector.
  • Added the property 'placeholder' instead of 'defaultText'. As the datepicker can be empty now, I think it would be useful to make use of the standard html placeholder attribute instead of setting the value with defaulText.
  • Added the property 'clearable'. This property set if the selector should show a clickable '×' where the user would be able to clean the selecte date*.
  • Added the property 'disabled'. Gives the developer the possibility to show the datetimepicker but not allowing the use of it.
  • React.Addons.classSet was also removed in favor of https://github.com/JedWatson/classnames as the old one it's deprecated in last versions of react (https://facebook.github.io/react/docs/class-name-manipulation.html).

*To be able to have selectedDate empty, I had to completely split viewDate and selectedDate along the code.

I think they are all my changes. We needed them really fast and maybe I didn't take long enought time to really check the code. But I hope that you get an idea of the features which I did and the code is helpful.

Again, thank you very much for all your work :)

Regards

alex1712 avatar May 30 '15 14:05 alex1712

I forgot,

I removed the console.log in the onChange, because sometimes I don't need any onChange handler and then the console.log will be shown all the time.

Regards

alex1712 avatar May 30 '15 14:05 alex1712

+1 from us. A datepicker which can have it's selectedDate value emptied is a must-have feature. Any prospects of a merge of alex1712's changes into the quri mainstream?

larry-cook avatar Sep 25 '15 00:09 larry-cook

Is there any progress on this case? Using placeholder instead of defaultText would be better, as in default text the input is not cleared when the user enter value.

cubbuk avatar Nov 11 '15 21:11 cubbuk