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
249 stars 252 forks source link

This Week Option is Selecting Today in ranges options (Happens Only on Monday) #435

Closed sanjeevkumar-ditstek closed 2 years ago

sanjeevkumar-ditstek commented 2 years ago

Versions

Describe the bug I have a custom range option as this.ranges = { "Today": [moment().set({ hours: 0, minutes: 0 }), moment().set({ minutes: 0 })], "This Week": [moment().startOf('isoWeek'), moment().set({ minutes: 0 })], }

So on monday when i select This Week Option it shows Today as selected

To Reproduce Steps to reproduce the behavior:

  1. Open Picker and select "This Week" then it will display Today as selected.

Expected behavior On Selecting "This Week" it should have to be display as active not "Today".

Additional context This happends only on Monday.

fetrarij commented 2 years ago

Hello @sanjeevkumar-ditstek ,

with your range ! today = 00:00am -> Now(0min) / this week = monday00:00am -> now(0min) and since today is monday, it means this this week = today

the first label wich have your value is selected.