bliblidotcom / vue-rangedate-picker

Range date picker with simple usage
https://bliblidotcom.github.io/vue-rangedate-picker/demo/
MIT License
217 stars 123 forks source link

Start date for Jan is shown wrongly when a date range between Dec and Jan is selected #96

Open radhakrishnan86 opened 2 years ago

radhakrishnan86 commented 2 years ago

When Dec and Jan months are selected, start day of Jan month is calculated based on year previous year. When 2021 Dec and Jan 2022 are selected, start day of Jan is calculated based on 2021 and not 2022. Jan 2022 should start with Saturday instead its starting with Friday. Below code is causing the issue.

    startNextMonthDay: function () {
      return new Date(this.activeYearStart, this.startNextActiveMonth, 1).getDay()
    },

Steps to reproduce

Select a date range between 2021 Dec and Jan 2022.

What is Expected?

Jan 1st 2022 should start with Saturday.

What is actually happening?

Jan 1st 2022 is starting with with Friday.