MCPcopy Create free account
hub / github.com/Lobos/react-ui / timeChange

Method timeChange

src/Datepicker/Datetime.js:197–216  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

195 }
196
197 timeChange (time) {
198 let d = this.changeDate(time),
199 timestamp = d.getTime();
200 let { min, max } = this.state;
201
202 let valid = true;
203 if (min > 0) {
204 valid = timestamp >= min;
205 }
206 if (valid && max > 0) {
207 valid = timestamp <= max;
208 }
209
210 if (valid) {
211 this.stateChange({ value: d, current: d }, true);
212 return true;
213 }
214
215 return false;
216 }
217
218 getTime () {
219 let current = this.state.current;

Callers

nothing calls this directly

Calls 3

changeDateMethod · 0.95
stateChangeMethod · 0.95
getTimeMethod · 0.80

Tested by

no test coverage detected