-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(datepicker): add activeDate to customClass for custom styling #5812
base: master
Are you sure you want to change the base?
Conversation
I could potentially see a use case whereby we keep the currently selected day/month when we navigate forward and backwards through the calendar rather than the current behavior. That said, this should be done in code as there is a specific line that handles this. I'm on mobile right now so I can't easily link it. I will say that at first glance the solution above seems fairly involved for what sounds like a simple change. All this said, if this is something we decide to pursue, we are going to need tests. |
Thanks for your feedback @icfantv . I feel as though the current functionality could be broken out a bit further, for example, today's date should have What I've submitted is the ability for a custom override on what is supported today, without resorting to manipulating the DOM directly. I guess that's the whole point of Technically it's a new enhancement that doesn't address #3879 directly, but let's you workaround it, or do other things of your own design. Ideally this would be added separate of fixing the Sure I can submit some tests, but perhaps we can get a bit more feedback on it first. I may be wrong but having had a quick look, it seemed like there was no existing testing for the |
Opened another PR with test coverage that addresses the I still do believe that While working on |
@jasonhargrove, right now, the biggest hurdle is that the datepicker API is already way too bloated and we are extremely reticent to add any more configuration to it. all this said, i've just done some quick scouring on the web and none of the jquery, angular material, or bootstrap datepicker implementations have this behavior. if anything, removing the active class functionality entirely seems to be a better UX and more inline with what everyone else is doing. i'm going to talk to the team and see what we want to do about this. |
@icfantv it is definitely bloated, and removing it would certainly solve the part of the problem where it's broken. There's a lot of code that seems to depend on this setting though, so removing it sounds like a job in and of itself. I looked at jQuery datepicker just now and indeed there is no active support, though they do have support for Thanks for taking a deeper look, please let me know if I can assist. |
@wesleycho, what are your thoughts on this? |
Proposed enhancement that passes the
activeDate
into thecustomClass
function which decorates thetd
element.Currently the
active class
is attached to the child button. The active date is a prominent feature of the calendar and thus feels important enough in the custom class context to justify this change.It's also an inexpensive addition that provides a non-invasive opportunity to address issues with the current
active class
. One example issue is here #3879.Here's a quick example that doesn't cover all use-cases.
On
td.non-current-month button.active
, disable the styling.In this case, the enhancement is used to override a design flaw where there is no
today
class, andactive
is attached to today, as well as the 1st of every non current month.