Commit 71056ac0 authored by ζ„šι“'s avatar ζ„šι“ Committed by 偏右

fix review issue

parent ae2a58d0
...@@ -132,7 +132,7 @@ class Analysis extends Component { ...@@ -132,7 +132,7 @@ class Analysis extends Component {
const { rangePickerValue } = this.state; const { rangePickerValue } = this.state;
const value = getTimeDistance(type); const value = getTimeDistance(type);
if (!rangePickerValue[0] || !rangePickerValue[1]) { if (!rangePickerValue[0] || !rangePickerValue[1]) {
return undefined; return '';
} }
if ( if (
rangePickerValue[0].isSame(value[0], 'day') && rangePickerValue[0].isSame(value[0], 'day') &&
...@@ -140,7 +140,7 @@ class Analysis extends Component { ...@@ -140,7 +140,7 @@ class Analysis extends Component {
) { ) {
return styles.currentDate; return styles.currentDate;
} }
return undefined; return '';
} }
render() { render() {
......
...@@ -47,12 +47,8 @@ export function getTimeDistance(type) { ...@@ -47,12 +47,8 @@ export function getTimeDistance(type) {
]; ];
} }
if (type === 'year') { const year = now.getFullYear();
const year = now.getFullYear(); return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
}
return undefined;
} }
export function getPlainNode(nodeList, parentPath = '') { export function getPlainNode(nodeList, parentPath = '') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment