[wp-trac] [WordPress Trac] #10397: Start of week and WEEK mysql date function

WordPress Trac wp-trac at lists.automattic.com
Tue May 4 22:25:39 UTC 2010


#10397: Start of week and WEEK mysql date function
-----------------------------------+----------------------------------------
 Reporter:  arena                  |        Type:  defect (bug)
   Status:  new                    |    Priority:  normal      
Milestone:  3.0                    |   Component:  Date/Time   
  Version:  2.9                    |    Severity:  major       
 Keywords:  has-patch dev-feedack  |  
-----------------------------------+----------------------------------------
Changes (by mdawaffe):

  * keywords:  needs-patch dev-feedack => has-patch dev-feedack


Comment:

 10397.diff

  1. Simplifies {{{get_weekstartend()}}} and makes it actually work for
 weird {{{start_of_week}}} values.
  2. Introduces {{{_wp_mysql_week()}}} to output the appropriate MySQL
 {{{WEEK()}}} expression given the {{{start_of_week}}} value.
  3. Fixes the {{{w}}} parameter of {{{WP_Query}}} to match the date ranges
 output by {{{wp_get_archives( weekly )}}}.  This means different blogs
 will display posts from different datetime ranges for queries like
 {{{year=2010&w=17}}}.  This seems ok to me: different blogs already
 display posts from different datetime ranges for every time based query
 because of time zone differences.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10397#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list