我正在做一个日程表,以便在日历中显示用户。我有一个javascript函数,可以获取两个日期之间的范围。我在html页面上有7个按钮,每个按钮都以一天命名,分别代表太阳、周一、周二。。。。如何从所选范围日期选择器按用户将所选日期推入数组
function getDates(startDate, stopDate) {
var dateArray = [];
var currentDate = moment(startDate);
var stopDate = moment(stopDate);
while (currentDate <= stopDate) {
dateArray.push(moment(currentDate).format('YYYY-MM-DD'))
currentDate = moment(currentDate).add(1, 'days');
}
return dateArray;
}
<div class="checkbox">
<input type="checkbox" class="ashrafdays ng-pristine ng-untouched ng-valid" ng-model="Listdatas.Sundy" id="IsSunday">
<label ng-show="!Listdatas.Sundy" class="title_lable sun_ico ng-hide" for="IsSunday" id="sun_ico" style="font-weight:bold;"></label>
<label ng-show="Listdatas.Sundy" class="title_lable sun_ico_g" for="IsSunday" id="sun_ico" style="font-weight:bold;"> </label>
</div>
暂无答案!
目前还没有任何答案,快来回答吧!