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

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 6 01:25:36 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:  needs-patch dev-feedack  |  
-------------------------------------+--------------------------------------

Comment(by hakre):

 Replying to [comment:9 arena]:
 > @hackre
 >
 > The point of this ticket is that get_option('start_of_week') can
 retrieve a value of 0 to 6 (Sunday to Saturday).
 >
 > WEEK(post_date, $start_of_week) only accept following values :
 > ...

 Right, that does not match to each other. So my patch was completely
 bogus. What's needed is a proper translation from the WP 0-6 value (0:
 Sunday, 1: Monday, ... and 6: Saturday) to something usefull in a/the
 mysql query (I'm seeing nothing of that on the mysql manual page related
 to the date/time functions).


 Replying to [comment:13 dd32]:
 > > in some languages, the week "starts" on a monday rather than on a
 sunday.
 > I was mainly wondering why we support it starting on Thursday.. I know
 Sunday and Monday are used - thus the support for it in WEEK, But wasnt
 aware of anything else.

 Maybe this can be properly verified against valid sources (I share that
 opinion but I'd like not to introduce problems here) and if so, it will
 save us a lot because those arguments can then be properly alligned. Maybe
 we should reduce that dropdown to two values: Sunday = 0 and Monday = 1.

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


More information about the wp-trac mailing list