简体   繁体   中英

Jquery - Calendar widget to pick weeks

Do we have any available calendar widgets in jquery/javascript which helps us to select a week rather than dates.

My application has 2 dropdowns, From week and To week.

This is something that you need:

 $('#weeklyDatePicker').on('dp.change', function (e) {
      var value = $("#weeklyDatePicker").val();
      var firstDate = moment(value, "MM-DD-YYYY").day(0).format("MM-DD-YYYY");
      var lastDate =  moment(value, "MM-DD-YYYY").day(6).format("MM-DD-YYYY");
      $("#weeklyDatePicker").val(firstDate + " - " + lastDate);
  });

for refrence you can check this link https://jsfiddle.net/Prakash_Thete/9usq3enn/

This may help you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM