引入:
   import moment from "moment"
获取当月第一天和最后一天
  
moment(new Date()).endOf('month').format("YYYY-MM-DD")
moment(new Date()).startOf('month').format("YYYY-MM-DD")

  

上一年:moment().add(-1, 'y').format("YYYY")
下一年:moment().add(1, 'y').format("YYYY")

  

相关文章:

  • 2022-12-23
  • 2021-07-30
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案