[wp-meta] [Making WordPress.org] #205: Add a UI for adding a session time on "add session" pages

Making WordPress.org noreply at wordpress.org
Fri Nov 7 19:45:56 UTC 2014

#205: Add a UI for adding a session time on "add session" pages
  Reporter:  melchoyce    |      Owner:  iandunn
      Type:  enhancement  |     Status:  closed
  Priority:  normal       |  Component:  wordcamp.org
Resolution:  fixed        |   Keywords:  good-first-bug has-patch

Comment (by iandunn):

 Great work on this Nowell, I know there are lots of organizers who will
 love this :)

 Also, kudos for using `aria-label` on the hour/minute dropdowns :)

 One potential drawback is that now there isn't any way for organizers to
 leave the date/time blank. I don't think that'll be an issue for anyone,
 but if it is then we can think about adding a checkbox for a null
 timestamp, or something to that effect.

 It looks like the bug I mentioned earlier was caused by the lack of
 padding in `$1` during the `for` loop for the minutes. `selected()` was
 comparing `(int) 5` against `(string) 05`. I changed it to:

 for ( $i = '00'; (int) $i <= 55; $i = sprintf( '%02d', (int) $i + 5 ) )

 Loosely-typed languages are fun sometimes :)

 I made a few other minor tweaks:
 * Added the optional year/month dropdowns to the datepicker, so users
 don't have to click a lot of times to go to a date a few months ahead of
 the current one.
 * Removed the `defaultDate` because it seemed unnecessary, since the
 picker defaults to the value of the input field already.
 * Removed the escaping on the `am` / `pm` strings. The note I made early
 about escaping safe values only applies to variables; it's overkill for
 hardcoded strings, since it's much safer to assume that any dev in the
 future who changes something hardcoded to user-input would then think
 about escaping it.

 One final suggestion: if your IDE has a setting to truncate whitespace
 from the end of lines ''only on modified lines'', then that will cut down
 on some of the diff noise that you can see in r968. I know PHPStorm does,
 but I'm not sure about others.

 That's all small stuff, though; I'm only mentioning because I know you're
 interested in getting lots of feedback :)

Ticket URL: <https://meta.trac.wordpress.org/ticket/205#comment:9>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org

More information about the wp-meta mailing list