swat
swat

Reputation: 69

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.

Upvotes: 0

Views: 143

Answers (1)

Margi
Margi

Reputation: 182

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

Upvotes: 1

Related Questions