Skip to content

fix(mismatch): Fixes date mismatch for year 2082 and 2083#67

Open
niroula-kushal wants to merge 3 commits into
leapfrogtechnology:masterfrom
niroula-kushal:fix/date-2082
Open

fix(mismatch): Fixes date mismatch for year 2082 and 2083#67
niroula-kushal wants to merge 3 commits into
leapfrogtechnology:masterfrom
niroula-kushal:fix/date-2082

Conversation

@niroula-kushal

Copy link
Copy Markdown
Contributor

Added tests for all months in those years.

@niroula-kushal

Copy link
Copy Markdown
Contributor Author

Somehow fixed the data and made it work.

No idea if there is a better way, or if the core algorithm requires changes.

Comment thread src/nepaliDatePicker.js
daysNumFromMinBsYear += bsDate + 1;
} else if (bsYear === 2081 && bsMonth === 12) {
daysNumFromMinBsYear += bsDate - 1;
} else if (bsYear === 2082 && bsMonth === 2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is forcefull way of doing it, instead i think we can update the core data.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I guess the core maintainers have to take a crack at it. This fix is just a brute force method intended to get the job done for a couple of months. We are bound to face this issue again next year or a year after.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this isn't correct. Nepali calendar data is readily available using that would simply this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants