| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import moment from 'moment';
- function today() {
- return __DEV__
- ? '2020-06-17 00:00:00,2020-06-17 23:59:59'
- : moment().format('YYYY-MM-DD') +
- ' 00:00:00,' +
- moment().add(1, 'days').format('YYYY-MM-DD') +
- ' 00:00:00';
- }
- function getSearchDate(showDate) {
- return (
- showDate +
- ' 00:00:00,' +
- moment(showDate, 'yyyy-MM')
- .add(1, 'months')
- .add(-1, 'seconds')
- .format('yyyy-MM-DD') +
- ' 23:59:59'
- );
- }
- class MonthDate {
- constructor() {
- var list = [];
- for (let i = 0; i < 6; i++) {
- list.push(
- moment()
- .add(0 - i, 'months')
- .format('yyyy-MM')
- );
- }
- this.showList = list;
- }
- }
- export { today, MonthDate, getSearchDate };
|