Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date and Day is incorrect #133

Open
vinothss4u opened this issue Sep 9, 2019 · 2 comments
Open

Date and Day is incorrect #133

vinothss4u opened this issue Sep 9, 2019 · 2 comments

Comments

@vinothss4u
Copy link

The Date and Day are incorrect in the date range picker.
For example:
September 2019 starts from Sunday(Sun) but it displays Monday.
Checked Version: 0.7.0 and 1.1.1

@Sum5Aleem
Copy link

Sum5Aleem commented Sep 19, 2019

Hi @GNURub ,
This issue happens whenever the month starts with the "Sunday".
To fix this issue in the file located
"https://github.com/GNURub/ngx-daterangepicker/blob/master/projects/ngx-daterangepicker/src/lib/ngx-daterangepicker/ngx-daterangepicker.component.ts"

replace line no 218 with the following code

let currentDay = dateFns.getDay(start);
let prevMonthDayNum = dateFns.getDay(start) - 1;
if (currentDay == 0) { prevMonthDayNum = 6; }

We checked with the following cases its working fine.
Apr 2018
Jul 2018
Sep 2019
Oct 2017
Jan 2017

@vinothss4u
Copy link
Author

vinothss4u commented Sep 20, 2019

Thank you!! The package related issue should be resolved by author and release new version.
If use npm install (https://www.npmjs.com/package/ngx-daterangepicker) and package.json the issue will be exists

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

No branches or pull requests

2 participants