我需要能够使用 jQuery 将 1、2、5 或 10 天添加到今天的日期。
最佳答案
你可以使用 JavaScript,不需要 jQuery:
var someDate = new Date();
var numberOfDaysToAdd = 6;
var result = someDate.setDate(someDate.getDate() + numberOfDaysToAdd);
console.log(new Date(result))
关于javascript - 如何将天数添加到今天的日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3818193/