Skip to content

Commit e4010de

Browse files
committed
All the classes have now the rdt prefix.
1 parent d359ebd commit e4010de

File tree

10 files changed

+71
-71
lines changed

10 files changed

+71
-71
lines changed

DateTime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ var Datetime = React.createClass({
225225
date
226226
;
227227

228-
if(target.className.indexOf("new") != -1)
228+
if(target.className.indexOf("rdtNew") != -1)
229229
modifier = 1;
230-
else if(target.className.indexOf("old") != -1)
230+
else if(target.className.indexOf("rdtOld") != -1)
231231
modifier = -1;
232232

233233
date = viewDate.clone()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ render: function() {
2929
return <Datetime />;
3030
}
3131
```
32-
[See this example working](http://codepen.io/arqex/pen/BNRNBw).
32+
[See this example working](http://codepen.io/arqex/pen/BoqgaG).
3333

3434
API
3535
===============================

css/react-datetime.css

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
position: static;
2525
}
2626

27-
.rdtPicker .timeToggle {
27+
.rdtPicker .rdtTimeToggle {
2828
text-align: center;
2929
}
3030

@@ -37,22 +37,22 @@
3737
text-align: center;
3838
height: 28px;
3939
}
40-
.rdtPicker td.day:hover,
41-
.rdtPicker td.hour:hover,
42-
.rdtPicker td.minute:hover,
43-
.rdtPicker td.second:hover,
44-
.rdtPicker .timeToggle:hover {
40+
.rdtPicker td.rdtToday:hover,
41+
.rdtPicker td.rdtHour:hover,
42+
.rdtPicker td.rdtMinute:hover,
43+
.rdtPicker td.rdtSecond:hover,
44+
.rdtPicker .rdtTimeToggle:hover {
4545
background: #eeeeee;
4646
cursor: pointer;
4747
}
48-
.rdtPicker td.old,
49-
.rdtPicker td.new {
48+
.rdtPicker td.rdtOld,
49+
.rdtPicker td.rdtNew {
5050
color: #999999;
5151
}
52-
.rdtPicker td.today {
52+
.rdtPicker td.rdtToday {
5353
position: relative;
5454
}
55-
.rdtPicker td.today:before {
55+
.rdtPicker td.rdtToday:before {
5656
content: '';
5757
display: inline-block;
5858
border-left: 7px solid transparent;
@@ -62,27 +62,27 @@
6262
bottom: 4px;
6363
right: 4px;
6464
}
65-
.rdtPicker td.active,
66-
.rdtPicker td.active:hover {
65+
.rdtPicker td.rdtActive,
66+
.rdtPicker td.rdtActive:hover {
6767
background-color: #428bca;
6868
color: #fff;
6969
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
7070
}
71-
.rdtPicker td.active.today:before {
71+
.rdtPicker td.rdtActive.rdtToday:before {
7272
border-bottom-color: #fff;
7373
}
74-
.rdtPicker td.disabled,
75-
.rdtPicker td.disabled:hover {
74+
.rdtPicker td.rdtDisabled,
75+
.rdtPicker td.rdtDisabled:hover {
7676
background: none;
7777
color: #999999;
7878
cursor: not-allowed;
7979
}
8080

81-
.rdtPicker td span.old {
81+
.rdtPicker td span.rdtOld {
8282
color: #999999;
8383
}
84-
.rdtPicker td span.disabled,
85-
.rdtPicker td span.disabled:hover {
84+
.rdtPicker td span.rdtDisabled,
85+
.rdtPicker td span.rdtDisabled:hover {
8686
background: none;
8787
color: #999999;
8888
cursor: not-allowed;
@@ -94,16 +94,16 @@
9494
width: 14.2857%;
9595
border-bottom: none;
9696
}
97-
.rdtPicker th.switch {
97+
.rdtPicker th.rdtSwitch {
9898
width: 100px;
9999
}
100-
.rdtPicker th.next,
101-
.rdtPicker th.prev {
100+
.rdtPicker th.rdtNext,
101+
.rdtPicker th.rdtPrev {
102102
font-size: 21px;
103103
vertical-align: top;
104104
}
105-
.rdtPicker th.disabled,
106-
.rdtPicker th.disabled:hover {
105+
.rdtPicker th.rdtDisabled,
106+
.rdtPicker th.rdtDisabled:hover {
107107
background: none;
108108
color: #999999;
109109
cursor: not-allowed;
@@ -133,14 +133,14 @@
133133
height: 100%;
134134
}
135135

136-
td.month,
137-
td.year {
136+
td.rdtMonth,
137+
td.rdtYear {
138138
height: 50px;
139139
width: 25%;
140140
cursor: pointer;
141141
}
142-
td.month:hover,
143-
td.year:hover {
142+
td.rdtMonth:hover,
143+
td.rdtYear:hover {
144144
background: #eee;
145145
}
146146

@@ -164,12 +164,12 @@ td.year:hover {
164164
line-height: 100px;
165165
}
166166

167-
.rdtCounter .btn {
167+
.rdtCounter .rdtBtn {
168168
height: 40%;
169169
line-height: 40px;
170170
cursor: pointer;
171171
}
172-
.rdtCounter .btn:hover {
172+
.rdtCounter .rdtBtn:hover {
173173
background: #eee;
174174
}
175175
.rdtCounter .rdtCount {

dist/react-datetime.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-datetime.min.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-datetime",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "A lightweight but complete datetime picker React.js component.",
55
"homepage": "https://github.com/arqex/react-datetime",
66
"repository": {

src/DaysView.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ var DateTimePickerDays = React.createClass({
1515
tableChildren = [
1616
DOM.thead({ key: 'th'}, [
1717
DOM.tr({ key: 'h'},[
18-
DOM.th({ key: 'p', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'months'), type: 'button' }, '‹')),
19-
DOM.th({ key: 's', className: 'switch', onClick: this.props.showView('months'), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),
20-
DOM.th({ key: 'n', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'months'), type: 'button' }, '›'))
18+
DOM.th({ key: 'p', className: 'rdtPrev' }, DOM.button({onClick: this.props.subtractTime(1, 'months'), type: 'button' }, '‹')),
19+
DOM.th({ key: 's', className: 'rdtSwitch', onClick: this.props.showView('months'), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),
20+
DOM.th({ key: 'n', className: 'rdtnext' }, DOM.button({onClick: this.props.addTime(1, 'months'), type: 'button' }, '›'))
2121
]),
2222
DOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day ){ return DOM.th({ key: day, className: 'dow'}, day ); }) )
2323
]),
@@ -69,23 +69,23 @@ var DateTimePickerDays = React.createClass({
6969
var lastDay = prevMonth.clone().add(42, 'd');
7070

7171
while( prevMonth.isBefore( lastDay ) ){
72-
classes = 'day';
72+
classes = 'rdtDay';
7373
currentDate = prevMonth.clone();
7474

7575
if( prevMonth.year() < currentYear || prevMonth.month() < currentMonth )
76-
classes += ' old';
76+
classes += ' rdtOld';
7777
else if( prevMonth.year() > currentYear || prevMonth.month() > currentMonth )
78-
classes += ' new';
78+
classes += ' rdtNew';
7979

8080
if( selected && prevMonth.isSame( {y: selected.year(), M: selected.month(), d: selected.date()} ) )
81-
classes += ' active';
81+
classes += ' rdtActive';
8282

8383
if (prevMonth.isSame(moment(), 'day') )
84-
classes += ' today';
84+
classes += ' rdtToday';
8585

8686
disabled = !isValid( currentDate, selected );
8787
if( disabled )
88-
classes += ' disabled';
88+
classes += ' rdtDisabled';
8989

9090
dayProps = {
9191
key: prevMonth.format('M_D'),
@@ -119,7 +119,7 @@ var DateTimePickerDays = React.createClass({
119119
var date = this.props.selectedDate || this.props.viewDate;
120120
return DOM.tfoot({ key: 'tf'},
121121
DOM.tr({},
122-
DOM.td({ onClick: this.props.showView('time'), colSpan: 7, className: 'timeToggle'}, date.format( this.props.timeFormat ))
122+
DOM.td({ onClick: this.props.showView('time'), colSpan: 7, className: 'rdtTimeToggle'}, date.format( this.props.timeFormat ))
123123
)
124124
);
125125
},

src/MonthsView.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ var DateTimePickerMonths = React.createClass({
99
render: function() {
1010
return DOM.div({ className: 'rdtMonths' },[
1111
DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
12-
DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'years'), type: 'button' }, '‹')),
13-
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2, 'data-value': this.props.viewDate.year()}, this.props.viewDate.year() ),
14-
DOM.th({ key: 'next', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'years'), type: 'button' }, '›'))
12+
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.button({onClick: this.props.subtractTime(1, 'years'), type: 'button' }, '‹')),
13+
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView('years'), colSpan: 2, 'data-value': this.props.viewDate.year()}, this.props.viewDate.year() ),
14+
DOM.th({ key: 'next', className: 'rdtNext' }, DOM.button({onClick: this.props.addTime(1, 'years'), type: 'button' }, '›'))
1515
]))),
1616
DOM.table({ key: 'months'}, DOM.tbody({ key: 'b'}, this.renderMonths()))
1717
]);
@@ -29,9 +29,9 @@ var DateTimePickerMonths = React.createClass({
2929
;
3030

3131
while (i < 12) {
32-
classes = "month";
32+
classes = "rdtMonth";
3333
if( date && i === month && year === date.year() )
34-
classes += " active";
34+
classes += " rdtActive";
3535

3636
props = {
3737
key: i,

src/TimeView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ var DateTimePickerTime = React.createClass({
3333
},
3434
renderCounter: function( type ){
3535
return DOM.div({ key: type, className: 'rdtCounter'}, [
36-
DOM.button({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ), type: 'button' }, '▲' ),
36+
DOM.button({ key:'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), type: 'button' }, '▲' ),
3737
DOM.div({ key:'c', className: 'rdtCount' }, this.state[ type ] ),
38-
DOM.button({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'decrease', type ), type: 'button' }, '▼' )
38+
DOM.button({ key:'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), type: 'button' }, '▼' )
3939
]);
4040
},
4141
render: function() {
@@ -83,7 +83,7 @@ var DateTimePickerTime = React.createClass({
8383

8484
var date = this.props.selectedDate || this.props.viewDate;
8585
return DOM.thead({ key: 'h'}, DOM.tr({},
86-
DOM.th( {className: 'switch', colSpan: 4, onClick: this.props.showView('days')}, date.format( this.props.dateFormat ) )
86+
DOM.th( {className: 'rdtSwitch', colSpan: 4, onClick: this.props.showView('days')}, date.format( this.props.dateFormat ) )
8787
));
8888
},
8989
onStartClicking: function( action, type ){

src/YearsView.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ var DateTimePickerYears = React.createClass({
99

1010
return DOM.div({ className: 'rdtYears' },[
1111
DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
12-
DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(10, 'years'), type: 'button' }, '‹')),
13-
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, year + '-' + (year + 9) ),
14-
DOM.th({ key: 'next', className: 'next'}, DOM.button({onClick: this.props.addTime(10, 'years'), type: 'button' }, '›'))
12+
DOM.th({ key: 'prev', className: 'rdtPrev' }, DOM.button({onClick: this.props.subtractTime(10, 'years'), type: 'button' }, '‹')),
13+
DOM.th({ key: 'year', className: 'rdtSwitch', onClick: this.props.showView('years'), colSpan: 2 }, year + '-' + (year + 9) ),
14+
DOM.th({ key: 'next', className: 'rdtNext'}, DOM.button({onClick: this.props.addTime(10, 'years'), type: 'button' }, '›'))
1515
]))),
1616
DOM.table({ key: 'years'}, DOM.tbody({}, this.renderYears( year )))
1717
]);
@@ -28,11 +28,11 @@ var DateTimePickerYears = React.createClass({
2828

2929
year--;
3030
while (i < 11) {
31-
classes = 'year';
31+
classes = 'rdtYear';
3232
if( i === -1 | i === 10 )
33-
classes += ' old';
33+
classes += ' rdtOld';
3434
if( selectedDate && selectedDate.year() === year )
35-
classes += ' active';
35+
classes += ' rdtActive';
3636

3737
props = {
3838
key: year,

0 commit comments

Comments
 (0)