Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

alex1712
Copy link

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

Alejandro Sellero and others added 16 commits April 23, 2015 17:00
…er into develop

# By Trevor Ewen (5) and others
# Via Loic CHOLLIER (2) and Loïc CHOLLIER (1)
* 'master' of github.com:quri/react-bootstrap-datetimepicker:
  Bump version to 0.0.15
  Adds maxDate / minDate example
  Fix maxDate
  Brings back build settings
  FIX: addMinute, addHour, subtractMinute, subtractHour are now updating inputValue. This is more logical and actually follows the orginal package.
  Added the cjs, amd, and bower_components directories to gitignore.
  Updated README with new properties.
  Latest cjs and amd builds.
  Updated the changedate method to ignore disabled days.
  Added the props for minDate and maxDate.

# Conflicts:
#	examples/basic/basic.jsx
#	package.json
#	src/DateTimeField.jsx
- Added disabled state.
@alex1712
Copy link
Author

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

@larry-cook
Copy link

+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?

@cubbuk
Copy link

cubbuk commented Nov 11, 2015

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants