Skip to content

Commit d76f7b0

Browse files
committed
Completely removed JSX from src
1 parent 9fb8e8e commit d76f7b0

17 files changed

+542
-1280
lines changed

src/DateTime.jsx renamed to DateTime.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
var assign = require('object-assign'),
44
React = require('react'),
5-
DaysView = require('./DaysView'),
6-
MonthsView = require('./MonthsView'),
7-
YearsView = require('./YearsView'),
8-
TimeView = require('./TimeView'),
5+
DaysView = require('./src/DaysView'),
6+
MonthsView = require('./src/MonthsView'),
7+
YearsView = require('./src/YearsView'),
8+
TimeView = require('./src/TimeView'),
99
moment = require('moment')
1010
;
1111

@@ -41,6 +41,7 @@ var Datetime = React.createClass({
4141
return {
4242
date: false,
4343
viewMode: 'days',
44+
inputProps: {},
4445
onChange: function (x) {
4546
console.log(x);
4647
}
@@ -269,15 +270,23 @@ var Datetime = React.createClass({
269270
},
270271

271272
render: function() {
272-
var Component = this.viewComponents[ this.state.currentView ];
273-
return (
274-
<div className="datetimePicker">
275-
<input ref="input" type="text" className="form-control" onFocus={this.openCalendar} onChange={this.onChange} value={this.state.inputValue} {...this.props.inputProps}/>
276-
<div className={ this.state.widgetClasses } style={ this.state.widgetStyle }>
277-
<Component { ...this.getComponentProps() } />
278-
</div>
279-
</div>
280-
);
273+
var Component = this.viewComponents[ this.state.currentView ],
274+
inputProps = assign({
275+
type:'text',
276+
className:'form-control',
277+
onFocus: this.openCalendar,
278+
onChange: this.onChange,
279+
value: this.state.inputValue
280+
}, this.props.inputProps ),
281+
DOM = React.DOM
282+
;
283+
284+
return DOM.div({className: 'datetimePicker'}, [
285+
DOM.input( inputProps ),
286+
DOM.div( {className: this.state.widgetClasses, style: this.state.widgetStyle },
287+
React.createElement( Component, this.getComponentProps() )
288+
)
289+
]);
281290
}
282291
});
283292

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ See [Examples](examples/) for more details.
2626
API
2727
===============================
2828

29-
DateTimeField
30-
========
31-
3229
| Name | Type | Default | Description |
3330
| ------------ | ------- | ------- | ----------- |
3431
| **date** | Date | new Date() | Represents the inital dateTime, this string is then parsed by moment.js |

css/bootstrap-datetimepicker.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@
180180
left: auto;
181181
right: 7px;
182182
}
183-
.dropdown-menu ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
184-
padding: 0px !important;
185-
}
186183

187184
td.month,
188185
td.year {

0 commit comments

Comments
 (0)