-
Notifications
You must be signed in to change notification settings - Fork 6
Fix sorting by dates #1033
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: staging
Are you sure you want to change the base?
Fix sorting by dates #1033
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ data class ProductEntity( | |
| @Column(nullable = false) | ||
| @field:JsonView(value = [ Edit::class, Preview::class, FullDetails::class ]) | ||
| @property:GenerateInput(type = InputType.NUMBER, order = 2, label = "Ár", min = 1, defaultValue = "100", note = "JMF-ben természetesen") | ||
| @property:GenerateOverview(columnName = "Ár", order = 1, centered = true) | ||
| @property:GenerateOverview(renderer = OverviewType.NUMBER, columnName = "Ár", order = 1, centered = true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM on the renderer change; unrelated pre-existing The added 🤖 Prompt for AI Agents |
||
| @property:ImportFormat | ||
| var price: Int = 0, | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,7 @@ data class RaceRecordEntity( | |
| @field:JsonView(value = [ Edit::class ]) | ||
| @property:GenerateInput(type = InputType.FLOAT3, order = 4, label = "Mért idő", defaultValue = "0.0", | ||
| note = "Másodpercben kell megadni, és ponttal (.) van elválasztva, nem vesszővel! 3 tizedes pontig lehet megadni pontosságot.") | ||
| @property:GenerateOverview(columnName = "Idő", order = 4, centered = true) | ||
| @property:GenerateOverview(renderer = OverviewType.TIME, columnName = "Idő", order = 4, centered = true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect the OverviewType.TIME enum entry to see its formatter/sorter config
fd -t f 'GenerateOverview.kt' | xargs -I {} sh -c 'echo "=== {} ==="; cat "{}"'Repository: kir-dev/cmsch Length of output: 1980
The 🤖 Prompt for AI Agents |
||
| @property:ImportFormat | ||
| var time: Float = 0.0f, | ||
|
|
||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 50370
🌐 Web query:
Tabulator datetime formatter unix timestamp inputFormat formatterParams💡 Result:
The Tabulator "datetime" formatter does not natively support Unix timestamps via inputFormat. Official docs for versions up to 6.4 show inputFormat expects Luxon format strings (e.g., "yyyy-MM-dd HH:mm") or "iso", but no "unix" option. In older versions using Moment.js (pre-5.0), "unix" worked unofficially due to Moment's flexible parsing of the 'x' token, but Luxon requires DateTime.fromMillis(value) for milliseconds since Unix epoch. Use a custom formatter function for Unix timestamps (assumed milliseconds; multiply by 1000 if seconds): { title: "Time", field: "timestamp", formatter: function(cell, formatterParams) { const value = cell.getValue; const dt = luxon.DateTime.fromMillis(value); return dt.isValid ? dt.toFormat(formatterParams.outputFormat || "yyyy-MM-dd HH:mm") : (formatterParams.invalidPlaceholder || "(invalid date)"); }, formatterParams: { outputFormat: "DD/MM/YY HH:mm", invalidPlaceholder: "(invalid date)" } } Include luxon.js before Tabulator. Ensure luxon.DateTime is globally available (e.g., window.DateTime = luxon.DateTime if using modules). This approach is confirmed in Stack Overflow discussions and GitHub issues for Tabulator 5.x+; no built-in Unix support in recent docs (6.4).
Citations:
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 1159
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
# Check if admin-script-4.js exists and read it wc -l backend/src/main/resources/static/js/admin-script-4.jsRepository: kir-dev/cmsch
Length of output: 116
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 10877
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 1485
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 313
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 50370
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 1518
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 2961
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 39
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 1905
🏁 Script executed:
Repository: kir-dev/cmsch
Length of output: 81
Sorting is fixed, but verify the timestamp units match between backend and frontend formatter.
The change to
sorter="number"correctly fixes sorting for the DATE column. However,formatValuepasses rawLongvalues unchanged (value ?: 0), and the frontend uses a customtimestampFormatterthat expects values in seconds (luxon.DateTime.fromSeconds(value)). If the backend sends timestamps in milliseconds instead, dates will render incorrectly despite sorting working. Confirm that all DATE field values are populated in seconds, not milliseconds, to avoid display issues.🤖 Prompt for AI Agents