Skip to content

Commit 9d279a3

Browse files
author
Jonny Pillar
committed
Revert "Display Slider Labels"
This reverts commit 5f7c7df.
1 parent 5f7c7df commit 9d279a3

File tree

5 files changed

+88
-114
lines changed

5 files changed

+88
-114
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ var TimeRangeSlider = require('react-time-range-slider')
2222
import React from 'react';
2323
import { render} from 'react-dom';
2424
import TimeRangeSlider from 'react-time-range-slider';
25-
import 'react-time-range-slider/dist/styles.css';
26-
2725
class App extends React.Component{
2826
constructor(props) {
2927
super(props);
@@ -65,8 +63,7 @@ class App extends React.Component{
6563
onChangeComplete={this.changeCompleteHandler}
6664
onChange={this.timeChangeHandler}
6765
step={15}
68-
value={this.state.value}
69-
formatLabel={(value) => {`${value}`}}/>
66+
value={this.state.value}/>
7067
</div>);
7168
}
7269
};
@@ -111,9 +108,6 @@ The amount of time, in minutes, increment/decrement when time range change.
111108
#### value: Range
112109
Set the current value for your component
113110

114-
#### formatLabel: Function(Value, Type): void
115-
By default, value labels are displayed as plain numbers. If you want to change the display, you can do so by passing in a function. The function can return something different, i.e.: append a unit, reduce the precision of a number.
116-
117111
## Defaults
118112
* disabled: `false`
119113
* draggableTrack: `false`
@@ -122,4 +116,4 @@ By default, value labels are displayed as plain numbers. If you want to change t
122116
* minValue: `00:00`
123117
* name: ` `
124118
* step: `15`
125-
* value: `{start: "00:00", end: "23:59"}`
119+
* value: `{start: "00:00", end: "23:59"}`

dist/index.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
"use strict";
1+
'use strict';
22

33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9-
var _react = require("react");
9+
var _react = require('react');
1010

1111
var _react2 = _interopRequireDefault(_react);
1212

13-
var _reactInputRange = require("react-input-range");
13+
var _reactInputRange = require('react-input-range');
1414

1515
var _reactInputRange2 = _interopRequireDefault(_reactInputRange);
1616

17+
require('./styles.css');
18+
1719
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1820

1921
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -36,22 +38,22 @@ var TimeRangeSlider = function (_Component) {
3638
}
3739

3840
_createClass(TimeRangeSlider, [{
39-
key: "componentDidMount",
41+
key: 'componentDidMount',
4042
value: function componentDidMount() {}
4143
}, {
42-
key: "componentWillUnmount",
44+
key: 'componentWillUnmount',
4345
value: function componentWillUnmount() {}
4446
}, {
45-
key: "minuteToTime",
47+
key: 'minuteToTime',
4648
value: function minuteToTime(value) {
4749
value = value > 1439 ? 1439 : value;
4850
var hours = Math.floor(value / 60),
4951
minutes = value - hours * 60,
5052
ampm = null;
5153

52-
if (hours.length == 1) hours = "0" + hours;
53-
if (minutes.length == 1) minutes = "0" + minutes;
54-
if (minutes == 0) minutes = "00";
54+
if (hours.length == 1) hours = '0' + hours;
55+
if (minutes.length == 1) minutes = '0' + minutes;
56+
if (minutes == 0) minutes = '00';
5557
if (this.props.format == 12) {
5658
ampm = "AM";
5759
if (hours >= 12) {
@@ -73,7 +75,7 @@ var TimeRangeSlider = function (_Component) {
7375
return { hours: hours, minutes: minutes, am_pm: ampm };
7476
}
7577
}, {
76-
key: "timeToMinute",
78+
key: 'timeToMinute',
7779
value: function timeToMinute(time) {
7880
var rMinutes = 1439;
7981
if (this.props.format == 24) {
@@ -109,7 +111,7 @@ var TimeRangeSlider = function (_Component) {
109111
return rMinutes > 1439 ? 1439 : rMinutes;
110112
}
111113
}, {
112-
key: "onChange",
114+
key: 'onChange',
113115
value: function onChange(value) {
114116
var start = this.minuteToTime(value.min);
115117
var end = this.minuteToTime(value.max);
@@ -125,7 +127,7 @@ var TimeRangeSlider = function (_Component) {
125127
});
126128
}
127129
}, {
128-
key: "onChangeComplete",
130+
key: 'onChangeComplete',
129131
value: function onChangeComplete(value) {
130132
var start = this.minuteToTime(value.min),
131133
end = this.minuteToTime(value.max);
@@ -135,7 +137,7 @@ var TimeRangeSlider = function (_Component) {
135137
});
136138
}
137139
}, {
138-
key: "onChangeStart",
140+
key: 'onChangeStart',
139141
value: function onChangeStart(value) {
140142
var start = this.minuteToTime(value.min),
141143
end = this.minuteToTime(value.max);
@@ -145,7 +147,7 @@ var TimeRangeSlider = function (_Component) {
145147
});
146148
}
147149
}, {
148-
key: "render",
150+
key: 'render',
149151
value: function render() {
150152
var _props$value = this.props.value,
151153
start = _props$value.start,
@@ -161,10 +163,8 @@ var TimeRangeSlider = function (_Component) {
161163
onChangeStart: this.onChangeStart.bind(this),
162164
onChange: this.onChange.bind(this),
163165
onChangeComplete: this.onChangeComplete.bind(this),
164-
formatLabel: this.props.formatLabel,
165-
step: this.props.step,
166-
value: { min: min, max: max }
167-
});
166+
step: 15,
167+
value: { min: min, max: max } });
168168
}
169169
}]);
170170

@@ -180,7 +180,6 @@ TimeRangeSlider.defaultProps = {
180180
onChange: function onChange() {},
181181
onChangeComplete: function onChangeComplete() {},
182182
onChangeStart: function onChangeStart() {},
183-
formatLabel: function formatLabel() {},
184183
step: 15,
185184
value: {
186185
start: "00:00",

examples/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import React from 'react';
33
import { render} from 'react-dom';
44
import TimeRangeSlider from '../src';
5-
import '../src/styles.css';
6-
75
class App extends React.Component{
86
constructor(props) {
97
super(props);

0 commit comments

Comments
 (0)