修复销售统计页面日期显示7月0号bug review by Author
Showing
1 changed file
with
3 additions
and
2 deletions
@@ -8,6 +8,7 @@ import CalendarTrigger from './calendar/CalendarTrigger'; | @@ -8,6 +8,7 @@ import CalendarTrigger from './calendar/CalendarTrigger'; | ||
8 | import CalendarPicker from './calendar/CalendarPicker'; | 8 | import CalendarPicker from './calendar/CalendarPicker'; |
9 | import ChartView from './chart/ChartView'; | 9 | import ChartView from './chart/ChartView'; |
10 | import LoadingIndicator from './indicator/LoadingIndicator'; | 10 | import LoadingIndicator from './indicator/LoadingIndicator'; |
11 | +import moment from 'moment'; | ||
11 | 12 | ||
12 | const { | 13 | const { |
13 | Component, | 14 | Component, |
@@ -48,7 +49,7 @@ export default class SaleStatistics extends Component { | @@ -48,7 +49,7 @@ export default class SaleStatistics extends Component { | ||
48 | constructor(props) { | 49 | constructor(props) { |
49 | super(props); | 50 | super(props); |
50 | 51 | ||
51 | - let selectdDate = new Date().getFullYear() + '年' + (new Date().getMonth() + 1) + '月' + (new Date().getDate() - 1) + '日'; | 52 | + let selectdDate = moment().subtract(1,'days').format('YYYY年MM月DD日'); |
52 | this.state = { | 53 | this.state = { |
53 | showPicker: false, | 54 | showPicker: false, |
54 | selectdDate, | 55 | selectdDate, |
@@ -111,7 +112,7 @@ export default class SaleStatistics extends Component { | @@ -111,7 +112,7 @@ export default class SaleStatistics extends Component { | ||
111 | } | 112 | } |
112 | 113 | ||
113 | render() { | 114 | render() { |
114 | - | 115 | + |
115 | return ( | 116 | return ( |
116 | <ScrollView contentContainerStyle={styles.contentContainer}> | 117 | <ScrollView contentContainerStyle={styles.contentContainer}> |
117 | <CalendarTrigger date={this.state.selectdDate} toogleSelector={this.toogleSelector} /> | 118 | <CalendarTrigger date={this.state.selectdDate} toogleSelector={this.toogleSelector} /> |
-
Please register or login to post a comment