feat: allow providing custom date format via base Date Formatter - #1928
Conversation
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1928 +/- ##
=========================================
+ Coverage 100.0% 100.0% +0.1%
=========================================
Files 187 187
Lines 34570 34578 +8
Branches 10282 10289 +7
=========================================
+ Hits 34544 34552 +8
Misses 26 26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@zewa666 so that's what I came up with to address custom date formats, I had to revisit Sorting & Filtering too, because without them working would have been confusing to the user and it's interesting to have them work too even if it increases the library size a tad more |
|
so how would that behave with a graphql/odata backend? would the outputDate control filter/sorting here as well? |
|
So what I had in mind was to make All I really wanted to do, was to provide an easier approach for the end user to provide any custom date format without having to create a custom formatter every time... and now with this updated PR it does just that, no need to touch Filtering/Sorting after all (the only sad thing is that we still need to use |
|
I can see the benefit for being able to quickly change the formats there without the need for custom formatter functions. sadly the reality is that more than often I find my anyways creating one due to sudden feature requests 😅 nevertheless this looks good except one thing I'd like to ask for how it behaved and that is copy&paste. enabling copy formatted value would respect this one as well I'd assume right? |
yes the logic is to check if there's a Formatter on the cell, if there is then run it to get formatted output and so that will behave the same as before because in the end this new PR just adds a basic Date Formatter (so when |

Allow the user to provide a custom date format via a new basic date Formatter, the user must provide the format through
params.dateFormatin his columnparams. Note that the input datetypemust still be provided the same as before, this PR is just an easier way to show different output format in the UIFor example
Demo
with the code above, we have this working demo