-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(library): Add customizable date format option for Library and History #15898
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
base: main
Are you sure you want to change the base?
Conversation
965eea1 to
a84520a
Compare
|
Thanks for the quick implementation! Besides that, it's not obvious that the format can be edited (not sure if that's what you referred to as bad UX?) Also, I'm struggling to understand the logic with the default, like what's the reasoning for If we go with a custom format, I suggest we add an enum class
Admittedly, dealing with the Custom item makes the TL;DR |
|
Thanks for this detailed discussion. I will look into it and take hints as to how to go ahead. |
Precisely yes!
Sounds good. Will implement it by the weekend, hopefully. |
Screen.Recording.2026-02-03.at.9.06.06.PM.mp4How does this look to you? (needs polishing, for instance the font box above is also changing which is unintentional. will push commits once i take care of it, just wanna if this looks promising.) |
|
Yeah, looks good! |
00b9ce9 to
6f83577
Compare
|
Did you get a chance to look at thi? @ronso0 (i feel u might have missed the notif) |
Didn't miss it, just kept this in my TODO as other stuff had higher prio (bug fixes and my own stuff) In general I'd appreciate the clang format fixes (is it auto-run on the entire file for you?) being a separate commit. And the date feature can be squashed into one commit IMHO. |
|
yeah, these clang format changes happen due to pre-commit. i will squash the commits as you said, before merge |
ronso0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly LGTM, see my prposal about the enum
| QVariant::fromValue( | ||
| static_cast<int>(BaseTrackTableModel::DateFormat::Native))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a Q_ENUM we don't need to cast to int and use
(at least this builds fine locally, let's see what the non-Ubuntu runners say)
| QVariant::fromValue( | |
| static_cast<int>(BaseTrackTableModel::DateFormat::Native))); | |
| QVariant::fromValue(BaseTrackTableModel::DateFormat::Native)); |
Likewise, in slotUpdate() we can use
int dateIndex = comboBox_dateFormat->findData(QVariant::fromValue(preset));
(there may be other occurences I overlooked)
|
While this works fine we now have two date variants:
I wonder what the best way forward is to sync both. |
how about we go ahead and write a dedicated function in /// Helper to format a QDateTime with a custom date format but using the system's
/// default locale for the time component.
/// This prevents the time from being dropped when the custom format is date-only.
inline QString formatDateTimeWithSystemTime(
const QDateTime& dt,
const QString& dateFormat = QString()) {
if (!dt.isValid()) {
return QString();
}
const QString dateStr = formatDate(dt.date(), dateFormat);
const QString timeStr = QLocale().toString(dt.time(), QLocale::ShortFormat);
return dateStr + QStringLiteral(" ") + timeStr;
}Just food for thought, as IMO this will make future changes (like changing the separator to I could open a new PR referencing this, once we get this merged. What say? |
23a54d8 to
0447c8d
Compare
I tried to squash the commits like you explained with this approach: But, it was kinda hectic and still not completely perfect. Am I missing something? |


This commit introduces a user preference to customize how dates are displayed across the Mixxx library and history views. It addresses the request for ISO 8601 compliance and allows completely custom date strings.
Key Changes:
Library Preferences UI:
ddd dd/MM/yyyy) directly into the combobox.Backend Integration:
BaseTrackTableModelnow holds a static global date format string, ensuring all Library and History views update dynamically without a restart.mixxx.cfgunder[Library], DateFormat.UI Layout Fixes:
QGridLayoutcolumn stretch factors to ensure a consistent, full-width appearance for all preference rows.Screen.Recording.2026-02-04.at.12.49.55.AM.mov
Fixes #15327