import React, { Component } from 'react'; import {observer} from 'mobx-react'; import { WeaDatePicker, WeaCheckbox, WeaLocaleProvider } from 'ecCom'; import moment from 'moment'; const getLabel = WeaLocaleProvider.getLabel; const DateTabItem = props => { const {store, tabInfo, idx} = props; const {selectedDateTabKey, getData} = store; const onClickHandle = () => { store.selectedDateTabKey = tabInfo.key; const current = new moment(); switch(tabInfo.key){ case '0': store.selectedDate = current.format('YYYY-MM-DD'); break; case '1': store.selectedDate = current.subtract(1, 'days').format('YYYY-MM-DD'); break; case '2': store.selectedDate = current.format('YYYY-MM'); break; } getData(); } return (