Skip to content
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

Sortable Date Columns #26

Open
Bush-cat opened this issue Jun 26, 2024 · 5 comments
Open

Sortable Date Columns #26

Bush-cat opened this issue Jun 26, 2024 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@Bush-cat
Copy link

Is your feature request related to a problem? Please describe.
I use a localized DateOnly in my Table but Sorting is broken because of the Date format DD/MM/YYYY.

Describe the solution you'd like
Make TextColumns respect Date classes or maybe make a DateColumn that can work with Date variables

Describe alternatives you've considered
Some way to implement sorting into a TextColumn yourself, this would also be usefull in other Cases, where I have an Icon next to my Text, there I couldn't use a TextColumn and decided to use two Columns instead, one for the icon, the other for the text.

@Bush-cat Bush-cat added the enhancement New feature or request label Jun 26, 2024
@VisualAlf
Copy link

VisualAlf commented Aug 7, 2024

IMHO the easiest way for this is to use a converter.
If you have eg. a numeric as the underlying datatype it will be sorted correctly, regardless of the displayed text format. See the SampleApp for usage with a DateTimeOffset.

@Bush-cat
Copy link
Author

Bush-cat commented Aug 9, 2024

IMHO the easiest way for this is to use a converter. If you have eg. a numeric as the underlying datatype it will be sorted correctly, regardless of the displayed text format. See the SampleApp for usage with a DateTimeOffset.

Converter could work, sadly Converters do not work with the Filter Menu, it shows the items without any conversion
Maybe the new template controls in v1.2.0-preview2 can do it. More TemplateColumn properties would help a lot.
I'm a bit struggling with localization in winui, I tried many ways already but they all suck in some way.

@w-ahmad
Copy link
Owner

w-ahmad commented Aug 16, 2024

You are correct, @Bush-cat; converters are not considered for sorting and filtering. Would it be suitable for you if the filter and sort methods use converters to get the final values?

@w-ahmad
Copy link
Owner

w-ahmad commented Aug 16, 2024

Date column is planned for v1.3, I'll share the roadmap soon.

@w-ahmad w-ahmad added this to the v1.3.0 milestone Aug 16, 2024
@Bush-cat
Copy link
Author

You are correct, @Bush-cat; converters are not considered for sorting and filtering. Would it be suitable for you if the filter and sort methods use converters to get the final values?

Converters for those would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants