vue Last 1 month Last 14 days Last month Current month

The picture above shows the effect

1. Last 7 days

   getSevenDays() {
      const currentDate = new Date();
      let startDate = new Date().setDate(currentDate.getDate() - 7);
      startDate = new Date(startDate);
      const endDate = new Date();
      return [startDate, endDate];
    }

2. Last 14 days

    getForDays() {
      const currentDate = new Date();
      let startDate = new Date().setDate(currentDate.getDate() - 14);
      startDate = new Date(startDate);
      const endDate = new Date();
      return [startDate, endDate];
    }

3.Last month

    getTdDays() {
      const currentDate = new Date

Guess you like

Origin blog.csdn.net/weixin_42066070/article/details/131051692
Recommended