fetrarij / ngx-daterangepicker-material

Pure Angular 2+ date range picker with material design theme, a demo here:
https://fetrarij.github.io/ngx-daterangepicker-material/
MIT License
246 stars 247 forks source link

End date is wrongly return on event #485

Open gopal-augment opened 1 year ago

gopal-augment commented 1 year ago

Versions

Describe the bug The end date is always the next day of what we selected in the date picker. This occurs in the demo site itself. Refer the screenshot.

To Reproduce Refer the screenshot

Expected behavior Should be the same date that we select in the date picket

Screenshots image

Demo site link Demo site

gopal-augment commented 1 year ago

is this because of

if (!this.timePicker) {
       this.pickingDate = false;
       this.endDate = this.endDate.add(1, 'd').startOf('day').subtract(1, 'second');
 }

in ngx-daterangepicker-material.mjs

Franccescalee commented 1 year ago

+1

I just had a bug ticket assigned to me that sounds like the same issue. We're using version 5.0.1, Angular 11

We have a preset for Month to Date, but if you select the 1st to yesterday it switches to Month to Date and pushes the end date out one day to today's date. I also tried removing the preset but it still pushes out the end date by one day.

If I comment out the lines listed above by @gopal-augment the issue doesn't occur so it must be causing this issue as well.

I've been trying to figure out a way to override that method using a Directive but it doesn't seem to work.

gopal-augment commented 1 year ago

@Franccescalee any update on this?

Franccescalee commented 1 year ago

@gopal-augment not that I know of. I ended up removing the ngx-daterangepicker-material library from my app and created my own component.

gopal-augment commented 1 year ago

@fetrarij

CPranay3 commented 11 months ago

@fetrarij Any Update on this? IS there any other alternative for it?

ranalav commented 11 months ago

compare timezone of local and utc , there must be jet lag