forked from misino/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Day.jsx
32 lines (29 loc) · 802 Bytes
/
Day.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/** @jsx React.DOM */
var React = require('react');
var Day = React.createClass(/** @lends {React.ReactComponent.prototype} */{
/**
*
* @param e
*/
handleClick: function(e) {
e.preventDefault();
this.props.changeDate(this.props.date);
},
/**
*
* @returns {{selected: boolean}}
*/
getDefaultProps: function() {
return {selected:false};
},
render: function() {
var className="day week-"+this.props.week+" dayInWeek-"+this.props.date.getDay();
className += (this.props.selected?' selected':'');
return (
<div className={className}>
<a href="#" onClick={this.handleClick}>{this.props.date.getDate()}</a>
</div>
);
}
});
module.exports = Day;