Skip to content

Commit 9c55be6

Browse files
andreasgrillsimeg
authored andcommitted
Allow multiple instances of component on same page
1 parent 45ce05c commit 9c55be6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/TimeView.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,28 @@ var DateTimePickerTime = React.createClass({
9999
},
100100
componentWillMount: function() {
101101
var me = this;
102+
me.timeConstraints = {
103+
hours: {
104+
min: 0,
105+
max: 23,
106+
step: 1
107+
},
108+
minutes: {
109+
min: 0,
110+
max: 59,
111+
step: 1
112+
},
113+
seconds: {
114+
min: 0,
115+
max: 59,
116+
step: 1,
117+
},
118+
milliseconds: {
119+
min: 0,
120+
max: 999,
121+
step: 1
122+
}
123+
};
102124
['hours', 'minutes', 'seconds', 'milliseconds'].forEach(function(type) {
103125
assign(me.timeConstraints[type], me.props.timeConstraints[type]);
104126
});
@@ -147,28 +169,6 @@ var DateTimePickerTime = React.createClass({
147169
document.body.addEventListener('mouseup', me.mouseUpListener);
148170
};
149171
},
150-
timeConstraints: {
151-
hours: {
152-
min: 0,
153-
max: 23,
154-
step: 1
155-
},
156-
minutes: {
157-
min: 0,
158-
max: 59,
159-
step: 1
160-
},
161-
seconds: {
162-
min: 0,
163-
max: 59,
164-
step: 1,
165-
},
166-
milliseconds: {
167-
min: 0,
168-
max: 999,
169-
step: 1
170-
}
171-
},
172172
padValues: {
173173
hours: 1,
174174
minutes: 2,

0 commit comments

Comments
 (0)