From 8499c27370fbb26b6a9514ff62776d78bfbe4c87 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 20 Feb 2008 07:01:36 +0000 Subject: [PATCH] Update date display in Manage Posts git-svn-id: https://develop.svn.wordpress.org/trunk@6933 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 83aab1ae80..a44f641d3f 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -372,27 +372,30 @@ foreach ($posts_columns as $column_name=>$column_display_name) { - post_modified ) _e('Never'); else the_modified_time(__('Y/m/d \<\b\r \/\> g:i:s a')); ?> - - - post_date ) { - _e('Unpublished'); + if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) { + $t_time = $h_time = __('Unpublished'); } else { - if ( ( abs(time() - get_post_time()) ) < 86400 ) { - if ( ( 'future' == $page->post_status) ) - echo sprintf( __('%s from now'), human_time_diff( get_post_time() ) ); - else - echo sprintf( __('%s ago'), human_time_diff( get_post_time() ) ); + if ( 'modified' == $column_name ) { + $t_time = get_the_modified_time(__('Y/m/d g:i:s A')); + $m_time = $page->post_modified; + $time = get_post_modified_time(); } else { - the_time(__('Y/m/d')); + $t_time = get_the_time(__('Y/m/d g:i:s A')); + $m_time = $page->post_date; + $time = get_post_time(); + } + if ( ( abs(time() - $time) ) < 86400 ) { + if ( ( 'future' == $page->post_status) ) + $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); + else + $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); + } else { + $h_time = mysql2date(__('Y/m/d'), $m_time); } } - ?> + ?> +