Skip to content

Commit f938951

Browse files
committed
Remove keys warning
1 parent 849f7f8 commit f938951

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/DateTimePickerDays.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ DateTimePickerDays = React.createClass({
6363
}
6464
}
6565
}
66-
cells.push(<td className={React.addons.classSet(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>);
66+
cells.push(<td key={prevMonth.month() + '-' + prevMonth.date()} className={React.addons.classSet(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>);
6767
if (prevMonth.weekday() === moment().endOf('week').weekday()) {
68-
row = <tr>{cells}</tr>;
68+
row = <tr key={prevMonth.month() + '-' + prevMonth.date()}>{cells}</tr>;
6969
html.push(row);
7070
cells = [];
7171
}

src/coffee/DateTimePickerDays.jsx.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ DateTimePickerDays = React.createClass(
5757
classes['disabled'] = true
5858
break;
5959

60-
cells.push `<td className={React.addons.classSet(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>`
60+
cells.push `<td key={prevMonth.month() + '-' + prevMonth.date()} className={React.addons.classSet(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>`
6161

6262
if prevMonth.weekday() == moment().endOf('week').weekday()
63-
row = `<tr>{cells}</tr>`
63+
row = `<tr key={prevMonth.month() + '-' + prevMonth.date()}>{cells}</tr>`
6464
html.push(row)
6565
cells = []
6666

0 commit comments

Comments
 (0)