()
| 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); |
no test coverage detected