[wp-trac] [WordPress Trac] #28063: 'dayofweek' deviates from ISO-8601

WordPress Trac noreply at wordpress.org
Sun Oct 26 21:16:40 UTC 2014


#28063: 'dayofweek' deviates from ISO-8601
-------------------------+-----------------------------
 Reporter:  mboynes      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Query        |     Version:  3.7
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+-----------------------------

Comment (by mboynes):

 Replying to [comment:2 boonebgorges]:
 Hey Boone, thanks for jumping on this!

 > I lean toward adding a new parameter, and at the same time not
 deprecating 'dayofweek'. I don't think there's anything wrong with having
 formal support for both the MySQL standard and the ISO standard. So I
 definitely would not remove the documentation or unit test for 'dayofweek'
 as you've done in your patches. If anything, I would expand the relevant
 documentation to make it clearer what the param does. We should do this
 regardless of whether we add another param.

 You make some great points here and I think this is worth a discussion. I
 would offer that "having formal support for both the MySQL standard and
 the ISO standard" is making an option and not a decision. As WordPress
 grows, I think it's important to consider these MySQL-centric features, as
 they make it more difficult to leverage new technologies (for instance, I
 stumbled across this while writing an Elasticsearch replacement for
 WP_Query). In short, I think that deprecating `dayofweek` is making a
 decision in favor of an international standard.

 > I'm not thrilled with the choice of 'weekday' for the name of the ISO-
 compliant param. One, it's got a connotation of M-F. Two, as noted in your
 patch, MySQL's `WEEKDAY` sets Monday to index 0 and Tuesday to 1. (Like I
 said, ugh.) How about something like 'dayofweek_iso'?

 I completely agree, `weekday` is not a good choice for the reasons you
 name, thanks for catching that. Naming it `dayofweek_iso` could work,
 depending on the result of the above discussion. `dayofweek_iso` makes
 perfect sense if we support both, but if we do deprecate `dayofweek`,
 `dayofweek_iso` seems second-class next to the deprecated `dayofweek`.

 I'd be very interested to hear other opinions on this too. Thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28063#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list