Skip to content

Number of days is not correct #57

Description

@medou-boushab

Hello Vincent,
Thanks for this great library.
We use the library in our project, and we discover that the nb of days in the selected month is not correct for example February is always 31 days.

would you accept a fix for this, I have two solutions for this
1- To change the value of monthDaysWithLasts :
monthDaysWithLasts: {
'1': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'2': ["1W"].concat(r(r(new Array(new Date(new Date().getFullYear(), 2, 0).getDate())).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'3': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'4': ["1W"].concat(r(r(new Array(30)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'5': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'6': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'7': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'8': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'9': ["1W"].concat(r(r(new Array(3)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'10': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'11': ["1W"].concat(r(r(new Array(30)).map(function(e,t){return"".concat(t+1)})),["LW","L"]),
'12': ["1W"].concat(r(r(new Array(31)).map(function(e,t){return"".concat(t+1)})),["LW","L"])
}

2- to calculate monthDaysWithLasts in a separate function

what do you think?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions