Media: Use numeric timestamps instead of string-based timestamps when preparing an attachment for js.

We use the 'date' attribute to create Javascript Date objects. The Date() constructor has better cross-browser compatibility when numeric arguments are passed to the constructor.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@21691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-08-31 19:14:43 +00:00
parent 9bd2e882ee
commit da9864c82a
1 changed files with 2 additions and 2 deletions

View File

@ -1565,8 +1565,8 @@ function wp_prepare_attachment_for_js( $attachment ) {
'name' => $attachment->post_name,
'status' => $attachment->post_status,
'uploadedTo' => $attachment->post_parent,
'date' => $attachment->post_date_gmt . ' UTC',
'modified' => $attachment->post_modified_gmt . ' UTC',
'date' => strtotime( $attachment->post_date_gmt ) * 1000,
'modified' => strtotime( $attachment->post_modified_gmt ) * 1000,
'mime' => $attachment->post_mime_type,
'type' => $type,
'subtype' => $subtype,