Skip to content

Commit 8abb28c

Browse files
committed
Adds prop and a changelog file. Release candidate
1 parent c658ad7 commit 8abb28c

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Changelog
2+
=========
3+
4+
## 1.0.0-rc.1
5+
This is the release candidate for this project. Now it is pretty usable and API won't change drastically in a while. If you were using the alpha versions (v0.x) there is a bunch of breaking changes:
6+
7+
* `date` prop is now called `defaultValue` and it is the initial value to use the component uncontrolled.
8+
* `value` prop has been added to use it as a [controlled component](https://facebook.github.io/react/docs/forms.html#controlled-components).
9+
* Removed `minDate` and `maxDate` props. Now to define what dates are valid it is possible to use the new `isValidDate` prop.
10+
* `dateFormat` and `timeFormat` default value is always the locale default format. In case that you don't want the component to show the date/time picker you should set `dateFormat`/`timeFormat` to `false`.
11+
12+
Moreover:
13+
* Buttons doesn't submit anymore when the Datetime component is in a form.
14+
* `className` prop has been added to customize component class.
15+
16+
17+
18+

DateTime.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ var Datetime = React.createClass({
3737
minDate: TYPES.object,
3838
maxDate: TYPES.object
3939
},
40+
4041
getDefaultProps: function() {
4142
var nof = function(){};
4243
return {
43-
className: 'form-control',
44+
className: '',
4445
value: false,
4546
defaultValue: new Date(),
4647
viewMode: 'days',
@@ -278,7 +279,7 @@ var Datetime = React.createClass({
278279
render: function() {
279280
var Component = this.viewComponents[ this.state.currentView ],
280281
DOM = React.DOM,
281-
className = 'rdt',
282+
className = 'rdt ' + this.props.className,
282283
children = []
283284
;
284285

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ API
4040
| **onChange** | function | empty function | Callback trigger when the date changes. The callback receives the selected `moment` object as only parameter. |
4141
| **onBlur** | function | empty function | Callback trigger for when the user clicks outside of the input, simulating a regular onBlur. The callback receives the selected `moment` object as only parameter. |
4242
| **viewMode** | string or number | 'days' | The default view to display when the picker is shown. ('years', 'months', 'days', 'time') |
43+
| **className** | string | `""` | Extra class names for the component markup. |
4344
| **inputProps** | object | undefined | Defines additional attributes for the input element of the component. |
4445
| **isValidDate** | function | () => true | Define the dates that can be selected. The function receives `(currentDate, selectedDate)` and should return a `true` or `false` whether the `currentDate` is valid or not. See [selectable dates](#selectable-dates).|
4546
| **renderDay** | function | DOM.td( day ) | Customize the way that the days are shown in the day picker. The accepted function has the `selectedDate`, the current date and the default calculated `props` for the cell, and must return a React component. See [appearance customization](#appearance_customization) |
@@ -119,4 +120,6 @@ Contributions
119120
===============================
120121
Any help is always welcome :)
121122

123+
### [Changelog](CHANGELOG.md)
124+
122125
### [MIT Licensed](LICENSE)

0 commit comments

Comments
 (0)