Skip to content

Commit 182c2b6

Browse files
committed
Fixed time not decreasing added buttons for controls
1 parent c37f80e commit 182c2b6

9 files changed

+34
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ require('moment/locale/fr');
5151

5252
If there are multiple locales loaded, you can use the prop `locale` to define what language should be used by the instance:
5353
```js
54-
<Datetime locale="fr" />
54+
<Datetime locale="fr-ca" />
5555
<Datetime locale="de" />
5656
```
5757
[Here you can see the i18n example working](http://codepen.io/arqex/pen/PqJMQV).

css/react-datetime.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
border-bottom: none;
9696
}
9797
.rdtPicker th.switch {
98-
width: 145px;
98+
width: 100px;
9999
}
100100
.rdtPicker th.next,
101101
.rdtPicker th.prev {
@@ -119,6 +119,20 @@
119119
border-top: 1px solid #f9f9f9;
120120
}
121121

122+
.rdtPicker button {
123+
border: none;
124+
background: none;
125+
cursor: pointer;
126+
}
127+
.rdtPicker button:hover {
128+
background-color: #eee;
129+
}
130+
131+
.rdtPicker thead button {
132+
width: 100%;
133+
height: 100%;
134+
}
135+
122136
td.month,
123137
td.year {
124138
height: 50px;

dist/react-datetime.js

Lines changed: 5 additions & 5 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: 2 additions & 2 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": "0.2.0",
3+
"version": "0.3.1",
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: 2 additions & 2 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', onClick: this.props.subtractTime(1, 'months') }, '‹'),
18+
DOM.th({ key: 'p', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'months')}, '‹')),
1919
DOM.th({ key: 's', className: 'switch', onClick: this.props.showView('months'), colSpan: 5 }, locale.months( date ) + ' ' + date.year() ),
20-
DOM.th({ key: 'n', className: 'next', onClick: this.props.addTime(1, 'months')}, '›' )
20+
DOM.th({ key: 'n', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'months')}, '›'))
2121
]),
2222
DOM.tr({ key: 'd'}, this.getDaysOfWeek( locale ).map( function( day ){ return DOM.th({ key: day, className: 'dow'}, day ); }) )
2323
]),

src/MonthsView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ var DateTimePickerMonths = React.createClass({
3636
render: function() {
3737
return DOM.div({ className: 'rdtMonths' },[
3838
DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
39-
DOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(1, 'years') }, '‹'),
40-
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, this.props.viewDate.year() ),
41-
DOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(1, 'years')}, '›' )
39+
DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(1, 'years')}, '‹')),
40+
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, this.props.viewDate.year() ),
41+
DOM.th({ key: 'next', className: 'next' }, DOM.button({onClick: this.props.addTime(1, 'years')}, '›'))
4242
]))),
4343
DOM.table({ key: 'months'}, DOM.tbody({ key: 'b'}, this.renderMonths()))
4444
]);

src/TimeView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ var DateTimePickerTime = React.createClass({
3030
},
3131
renderCounter: function( type ){
3232
return DOM.div({ key: type, className: 'rdtCounter'}, [
33-
DOM.div({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '▲' ),
33+
DOM.button({ key:'up', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '▲' ),
3434
DOM.div({ key:'c', className: 'rdtCount' }, this.state[ type ] ),
35-
DOM.div({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'increase', type ) }, '▼' )
35+
DOM.button({ key:'do', className: 'btn', onMouseDown: this.onStartClicking( 'decrease', type ) }, '▼' )
3636
]);
3737
},
3838
render: function() {

src/YearsView.js

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

3737
return DOM.div({ className: 'rdtYears' },[
3838
DOM.table({ key: 'a'}, DOM.thead({}, DOM.tr({},[
39-
DOM.th({ key: 'prev', className: 'prev', onClick: this.props.subtractTime(10, 'years') }, '‹'),
40-
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 5 }, year + '-' + (year + 9) ),
41-
DOM.th({ key: 'next', className: 'next', onClick: this.props.addTime(10, 'years')}, '›' )
39+
DOM.th({ key: 'prev', className: 'prev' }, DOM.button({onClick: this.props.subtractTime(10, 'years')}, '‹')),
40+
DOM.th({ key: 'year', className: 'switch', onClick: this.props.showView('years'), colSpan: 2 }, year + '-' + (year + 9) ),
41+
DOM.th({ key: 'next', className: 'next'}, DOM.button({onClick: this.props.addTime(10, 'years')}, '›'))
4242
]))),
4343
DOM.table({ key: 'years'}, DOM.tbody({}, this.renderYears( year )))
4444
]);

0 commit comments

Comments
 (0)