-
-
Notifications
You must be signed in to change notification settings - Fork 531
DatePicker: Adds "Today" button #6089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
It works, so that is good. Although I would like to make it part of our flatpickr fork if possible. This is a good candidate for the first work. I don't really like how the button looks as a link. And it doesn't look like it belongs to the framework styling. BS4 FluentUI For reference, you can see the real fluent design at https://react.fluentui.dev/?path=/docs/compat-components-datepicker--docs So, instead of having an inline style in JS <button type="button" class="today-button"
style="color: #007bff; background-color: transparent; border: none; padding: 4px 8px; cursor: pointer; text-decoration: underline;">
${localizedToday}
</button> I would do this:
But even before that, I would first implement it on our flatpickr fork. And make it resemble their default day item styling. |
The link buttons try to mimic what I added the "Today" feature rather as a hotfix. About The question is whether you truly want to commit to keeping this horse alive — it contains a decade-old npm packages, not part of our tech stack, and it carries a lot of technical baggage. It's destined to fail sooner or later. Unfortunately, there's no direct alternative that matches Spending resources on this dead horse is unwise unless you're ready to commit long-term. And I don't event see point in that. From my understanding, date picking isn’t rocket science (I have done calendar once). There are three main parts:
There aren’t that many features. I suggest we rewrite it properly in Blazor:
|
It's not such an easy thing to do in Blazor. That's why we used Flatpickr in the first place. For example, we have almost no control over how to properly handle input masks. There is no way to prevent invalid value natively in Blazor. So we would then had to fall back to JSInterop for every edge case. We actually had this in the past on one of the early Blazorise components. It was a nightmare to maintain after a while. So I removed it sometime in 0.9.x version, I think 🤔 And input mask is just one feature we need. There is also a display format, which is then again different from internal value. I mean, we could come close to what we need but why solve something that is already solved. |
…tton options to faltpickr itself. Styling bs5.
Because it no longer fits our overall needs. Instead of solving the input mask issue, we now carry the burden of keeping flatpickr "alive." Anyway, it's done — our fork of flatpickr now has the Initialization, option changes, and localization changes all call the same function in js — all the logic is centralized. I styled it using the |
Description
Closes #6061

Not the cleanest solution, but since flatpicker support is lacking we don't have much other options.
One option can be to change our flatpicker fork, but I am not sure if it's work it.
The current solution does what plugins do, just in our custom js.