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.
There is a typo when replacing d in mysql.
Here is the documentation for reference:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Comment | File | Size | Author |
---|---|---|---|
#7 | views_date_sql_format_ext_3.patch | 1.32 KB | jcmarco |
#4 | views_date_sql_format_ext_2.patch | 1.3 KB | jcmarco |
#2 | views_date_sql_format_ext.patch | 1.32 KB | jcmarco |
#1 | views_date_sql_format.patch | 370 bytes | jcmarco |
Comments
Comment #1
jcmarco CreditAttribution: jcmarco commentedComment #2
jcmarco CreditAttribution: jcmarco commentedI have extended the most usual date formats
From:
http://us.php.net/manual/en/function.date.php
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
http://developer.postgresql.org/pgdocs/postgres/functions-formatting.html
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedThe '%%d' is not a typo. It is there because '%d' will get processed by db_query() and will mess up any arguments to the query.
Comment #4
jcmarco CreditAttribution: jcmarco commentedOk, I found it while testing with more strings.
I even found that %b requires to be escaped as well.
Changed for a feature request to support more strings.
I am working in a patch for views_handler_field_date.inc to support
date formats configured with Data API, and option to support native
date_format in queries to solve problems grouping information.
Comment #5
jcmarco CreditAttribution: jcmarco commentedComment #6
merlinofchaos CreditAttribution: merlinofchaos commentedIt would be true for %b, %d, %s, %f -- I see a %s in there too. Odd that %d was covered and %s was not.
Comment #7
jcmarco CreditAttribution: jcmarco commentedYou were absolutely right!
The %s was wrong.
I didn't translate %f as it seems that using microseconds is not usual.
Do you consider a good idea trying to translate all the strings from http://us.php.net/manual/en/function.date.php?
Comment #8
robby.smith CreditAttribution: robby.smith commentedsubscribing
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedUnsurprisingly, this does not apply to D7. COmmitted to D6 branches.
Comment #10
dawehnerPorted and commited.