-
Notifications
You must be signed in to change notification settings - Fork 126
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
Date sorting on the Notifications page is not date sorting #1653
Comments
Ah, maybe |
this was observed on 2alpha. |
@vantuyls I'd like to tag this with the 2.0.0 milestone, but that milestone is currently polluted with many many issues. Might you have time to work w/ me on clearing out that milestone so we can make it useful for us? |
Can do. |
This seems to be a basic misunderstanding of how dataTables sorting works. i.e. in _notifications.html.erb will be sort by the iso8601 representation of the date as opposed to the underlying relative-time string. The (:long_ordinal) content will just be a default form displayed if the relative-time fails to correctly parse the |
Adding a `data-sort` with ISO 8601 datetimes allows dataTables to sort independent of the visible row values. We continue to use javascript to generate the human-readable time for the reasons given in #1416 (support for page caching). We sort to `#iso8601(5)` (i.e. to 5 decimal places). This still allows a mismatch between displayed times and correctly sorted times (off by one second), apparently due to rounding behavior in the javascript sort dates. The actual dates sort correctly, so display dates sort themselves out (ha!) as a notification ages past one minute. Fixes #1653.
Adding a `data-sort` with ISO 8601 datetimes allows dataTables to sort independent of the visible row values. We continue to use javascript to generate the human-readable time for the reasons given in #1416 (support for page caching). We sort to `#iso8601(5)` (i.e. to 5 decimal places). This still allows a mismatch between displayed times and correctly sorted times (off by one second), apparently due to rounding behavior in the javascript sort dates. The actual dates sort correctly, so display dates sort themselves out (ha!) as a notification ages past one minute. Fixes #1653.
Adding a `data-sort` with ISO 8601 datetimes allows dataTables to sort independent of the visible row values. We continue to use javascript to generate the human-readable time for the reasons given in #1416 (support for page caching). We sort to `#iso8601(5)` (i.e. to 5 decimal places). This still allows a mismatch between displayed times and correctly sorted times (off by one second), apparently due to rounding behavior in the javascript sort dates. The actual dates sort correctly, so display dates sort themselves out (ha!) as a notification ages past one minute. Fixes #1653.
Adding a `data-sort` with ISO 8601 datetimes allows dataTables to sort independent of the visible row values. We continue to use javascript to generate the human-readable time for the reasons given in #1416 (support for page caching). We sort to `#iso8601(5)` (i.e. to 5 decimal places). This still allows a mismatch between displayed times and correctly sorted times (off by one second), apparently due to rounding behavior in the javascript sort dates. The actual dates sort correctly, so display dates sort themselves out (ha!) as a notification ages past one minute. Fixes #1653.
Descriptive summary
The notifications page allows the notification table to be sortable by date (among other things) but the sorting on this field isn't actually sorting on date, it is sorting alphanumerically on the text in the date field.
Expected behavior
Sorting the Date field in this (or any) table should sort on date/time
Actual behavior
Sorting the Date field in this table sorts alphanumerically
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: