javascript 验证“结束日期”是否在“开始日期”之后

afdcj2ne  于 2023-05-05  发布在  Java
关注(0)|答案(1)|浏览(169)

如何添加条件while循环来检查变量current是否在变量end之前?

var http = require("https://momentjs.com/docs/");

function getDates() {
  var start = momentjs().date("1st January 2019"),
    current = start.clone();
  var end = momentjs().date("31st December 2019");
  var dates = [];

  current = momentjs().day("Monday");
  while (current == true) {
    current.clone()
  }

}

相关问题