startbootstrap-sb-admin-2 icon indicating copy to clipboard operation
startbootstrap-sb-admin-2 copied to clipboard

(version 2.0.2) - Wrong days are displayed for August 2021 so far (wrong offset in DateRange Picker - Litepicker lib)

Open aleaforny opened this issue 4 years ago • 1 comments

Steps to reproduce

You can reproduce this directly on the demo preview : https://startbootstrap.com/previews/sb-admin-pro (Click in menu UI Toolkit > Components > Forms > Date Range Picker)

Problem identified

image

You can see that August's start on Monday 1st, even though it started on Sunday this month. As a result, all the dates are with a wrong offset. I've only seen this bug within this current month, all other months seem fine.

Troubleshooting : How to be sure it's not a Litepicker's related bug?

  1. Here's a JS fiddle to prove the lib's working well: https://jsfiddle.net/7zbmtwyq/ (August starts on a Sunday)
  2. If you remove the Litepicker's CSS override directives from file scss/admin/plugins/_litepicker.scss, you'll see that everything is working perfectly (even though we loose the SB Admin CSS for this input)

So I guess there is something wrong with these CSS directives

aleaforny avatar Aug 14 '21 18:08 aleaforny

In addition to the last troubleshooting, I've found something interesting:

Within _litepicker.scss, if you remove the margin directive (margin: 2px;) from &__days { >div, > {...} } (line 141 on my file), everything works well again (even though the CSS rendering is not nice, I guess this margin is important but it creates this bug)

Forgot to mention that I've tested this on Chrome & Firefox

Thanks

aleaforny avatar Aug 14 '21 18:08 aleaforny