Parse update date before sorting in media list view#19711
Merged
leekelleher merged 2 commits intov13/devfrom Jul 16, 2025
Merged
Parse update date before sorting in media list view#19711leekelleher merged 2 commits intov13/devfrom
leekelleher merged 2 commits intov13/devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where date fields in the media picker list view were being sorted alphabetically instead of chronologically. The change ensures that update dates are properly parsed as Date objects before sorting to provide the expected date-time ordering.
- Adds date parsing logic to convert string dates to numeric timestamps for proper chronological sorting
- Maintains fallback behavior for invalid dates by returning the original string value
src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js
Outdated
Show resolved
Hide resolved
leekelleher
approved these changes
Jul 16, 2025
This was referenced Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Resolves: #19695
Description
In the media picker list view, when sorting, date fields are sorted alphabetically.
This PR attempts to parse the date entry to a date before doing the sorting.
Testing
To replicate the original issue you need some media or folders that when ordered alphabetically aren't ordered by date and time.
With the PR applied you should see them ordered by date and time as would be expected.