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

Method getValue

src/Datepicker/Datetime.js:68–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 getValue () {
69 let value = this.state.value;
70 if (!value) {
71 return null;
72 }
73
74 // if dateOnly, remove time
75 if (this.props.type === DATE) {
76 value = new Date(value.getFullYear(), value.getMonth(), value.getDate());
77 }
78
79 if (this.props.unixtime) {
80 // cut milliseconds
81 return Math.ceil(value.getTime());
82 } else {
83 return this.formatValue(value);
84 }
85 }
86
87 setValue (value) {
88 value = datetime.convert(value, null);

Callers 2

stateChangeMethod · 0.95
handleChangeFunction · 0.45

Calls 2

formatValueMethod · 0.95
getTimeMethod · 0.80

Tested by

no test coverage detected