Skip to main content

Notice

Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: Sorting Question using Date Column (Read 225 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sorting Question using Date Column

Greetings, thanks for having a look.

In using the following string under Default User Interface | Playlist View | Custom Column :
$month(%added%)/$day_of_month(%added%)/$year(%added%)

this shows up properly as 02/12/2021 , however when clicking the top of the column Date Added to perform a Sort, the listings show up Month first, not the ascending / descending by historical actual date.  As an example, all of the tries for the month of February are sorted no matter what year.  
I could put the year first instead of the month in the string but then the appearance wouldn't look proper [using the USA format such as 02/12/2021]. Might anyone have a suggestion on how to correct this? My goal is to sort and have the newest entries appear at the top [or bottom] of the list.
Thanks in advance (please be as detailed as possible as another user was kind enough to put this string together)
Rev

Re: Sorting Question using Date Column

Reply #1
(Just FYI, I use ColumnsUI but this is probably applicable to Default UI as well)
From my experience, clicking the column to sort always sorts by the contents shown in the column. I believe the only way to sort by year first is to do as you said and write the date YYYY/MM/DD. I actually prefer it that way, but I can see why some wouldn't. Unfortunately, I've had that kind of problem with other columns though.

Just a quick thought - it would be pretty cool if you could have a script for display, as usual, and also a script for sort. But that would probably require a lot of new coding.
Think millionaire, but with cannons.

Re: Sorting Question using Date Column

Reply #2
Guess I'll have to revert to the year first.  I do have the Columns UI installed but added this string under the Default UI.  I should look into predesigned Column UI exports.  If you know of a site where I can try and sample Columns UI scripts would be great. Thanks again for the reply. Still in the learning process :)

Re: Sorting Question using Date Column

Reply #3
I don't live in the US but we use DD/MM/YYYY where I am, which is almost as mental. Once you get used to YYYY/MM/DD you'll wonder why you ever did it any other way. :)

Until someone with a better idea comes along.... and I can't test this because I don't have the Playback What's-It component installed... but try creating two date columns. Add one to the left of the Playlist and the other where-ever. For the one on the left, use the YYYY/MM/DD format for sorting, for the second one, do whatever takes your fancy.
Once you've added the columns, click on the left one to sort, then grab the right edge of that column and drag it to the left until it disappears. When you need to sort again, unhide it, click to sort, and hide it again.

I suggested putting it on the left as I think that'll make it easier to hide/unhide without messing with the other columns, but of course you can add it to the right side of the existing columns, click to sort and then disable it until you need it again. You should be able to use
$date(%added%)$time(%added%)
for sorting to the nearest second.

If you don't change your playlists much once they're setup, the Playlist Tools component adds a "read only" option to the edit menu. It can be checked for individual playlists (well, it has to be) and prevents messing with the sorting through accidentally clicking on a column header.

One other thought... to use the second column for sorting without having to enable/disable or hide it etc, add a few spaces to the beginning of the column name and the same before the column syntax. That should allow you to leave enough of it showing to be clickable, but without it displaying anything. Something like this:

Re: Sorting Question using Date Column

Reply #4
Hi Yetanotherid..thanks for the ideas. I was thinking the same, making two columns. I did the year first as Cannonaire suggested and am getting used to this view/sort in a single column.  If that doesn't pan out, then yes the 2 column approach would be suffice.  Also the spacing idea is also a good suggestion if going the two column route. Clever, thanks!

 
SimplePortal 1.0.0 RC1 © 2008-2021