Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just add a sort criterion (see screenshot). Here is SQL query:
SELECT node.title AS node_title, node.nid AS nid
FROM
{node} node
ORDER BY node_created_hour DESC
LIMIT 10 OFFSET 0
It seems as we forgot about SQLite in views_date_sql_format().
Comment | File | Size | Author |
---|---|---|---|
#5 | 1296060-sqlite-support.patch | 1.74 KB | dawehner |
sort_criterion.png | 31.92 KB | Chi |
Comments
Comment #1
dawehnerYou are sadly right. As you use sqlite you are probably more an expert in sqlite.
Please assign the issue to yourself if you can work on it.
Comment #2
dawehnerUpdate title
Comment #3
Chi CreditAttribution: Chi commentedI am not expert in sqlite. After digging in the code of includes/handlers.inc i found a few functions that are needed to be changed:
views_get_timezone(), views_date_sql_format() and views_date_sql_extract().
There is an article (probably in spanish) that may be helpful for you.
http://www.diegotundo.name/blog/archive-view-su-drupal-7-e-sqlite-errore...
Comment #4
Chi CreditAttribution: Chi commentedComment #5
dawehnerThat's great! I just use the main part of this code to create a patch. It would be really great if you could test it.
Comment #6
Chi CreditAttribution: Chi commentedWhat about views_get_timezone() ?
Comment #7
Chi CreditAttribution: Chi commentedI have tested date sorting with granularity, The patch works for me.
Comment #8
Diego Tundo CreditAttribution: Diego Tundo commentedI am the author of the article and I'm really happy to help you! Please contact me if you need on twitter.
Comment #9
dawehnerThanks for testing the patch. Commited to 7.x-3.x
I talked it some sqlite folks and they set there is no function to convert the timezone.