[Bug]: Sorting the library page by publish year doesnt work properly for years below 1000 #2361

Closed
opened 2026-04-25 00:06:31 +02:00 by adam · 1 comment
Owner

Originally created by @nikerl on GitHub (Nov 17, 2024).

What happened?

When sorting the library by publishing year the books with a publish year under 1000 are sorted incorrectly. For example 200 is sorted as 2000. 375 will be sorted as 3750

It appears that year are padded with trailing zeros to get up 4 digits. Also any digits over 4 are cut, however this part wont be a problem for a few years.

What did you expect to happen?

Books should be sorted correctly even when the publishing year is <1000

Steps to reproduce the issue

  1. Go to the library page
  2. Sort by "Publish year"
  3. Choose any book and set the publish year to something <1000, for example 200
  4. Refresh the page

Audiobookshelf version

v2.16.2

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

Originally created by @nikerl on GitHub (Nov 17, 2024). ### What happened? When sorting the library by publishing year the books with a publish year under 1000 are sorted incorrectly. For example 200 is sorted as 2000. 375 will be sorted as 3750 It appears that year are padded with trailing zeros to get up 4 digits. Also any digits over 4 are cut, however this part wont be a problem for _a few_ years. ### What did you expect to happen? Books should be sorted correctly even when the publishing year is <1000 ### Steps to reproduce the issue 1. Go to the library page 2. Sort by "Publish year" 3. Choose any book and set the publish year to something <1000, for example 200 4. Refresh the page ### Audiobookshelf version v2.16.2 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs _No response_ ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:06:31 +02:00
adam closed this issue 2026-04-25 00:06:31 +02:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 17, 2024):

Fixed in v2.17.0.

@github-actions[bot] commented on GitHub (Nov 17, 2024): Fixed in [v2.17.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.17.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2361