[wp-trac] [WordPress Trac] #39222: Add JavaScript date helpers

WordPress Trac noreply at wordpress.org
Tue Mar 7 12:12:21 UTC 2017


#39222: Add JavaScript date helpers
---------------------------------------------------+-----------------------
 Reporter:  rmccue                                 |       Owner:  rmccue
     Type:  feature request                        |      Status:  assigned
 Priority:  normal                                 |   Milestone:  4.8
Component:  Date/Time                              |     Version:  4.7
 Severity:  normal                                 |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-docs  |     Focuses:  rest-api
---------------------------------------------------+-----------------------

Comment (by flixos90):

 The patch is looking great as far as I can tell (but let's wait for
 further reviews by more JSy people than me). I had implemented the mapping
 in a similar way in another project (the implementation here is more
 complete though), so I guess it shows we're following an approach that
 makes sense. I agree that using Moment.js is the right choice as we don't
 need to reinvent the wheel, and mapping the PHP formats is rather
 straightforward.

 Something minor to consider: Instead of hard-coding `__( 'F j, Y g:i a' )`
 for the datetime setting, could we instead concatenate the `date_format`
 and `time_format` values with a space? Also, what is `formats.timezone`
 used for (I couldn't see it anywhere in the code, why is that necessary)?

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


More information about the wp-trac mailing list