ngx-daterangepicker-material icon indicating copy to clipboard operation
ngx-daterangepicker-material copied to clipboard

End date is wrongly return on event

Open gopal-augment opened this issue 1 year ago • 7 comments

Versions

  • Angular version: 14
  • component version: 6.0.4

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 avatar Oct 18 '22 09:10 gopal-augment

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

gopal-augment avatar Oct 18 '22 10:10 gopal-augment

+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.

Franccescalee avatar Oct 19 '22 14:10 Franccescalee

@Franccescalee any update on this?

gopal-augment avatar Dec 20 '22 16:12 gopal-augment

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

Franccescalee avatar Dec 20 '22 16:12 Franccescalee

@fetrarij

gopal-augment avatar Dec 21 '22 00:12 gopal-augment

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

CPranay3 avatar Jul 12 '23 12:07 CPranay3

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

ranalav avatar Aug 02 '23 06:08 ranalav