Fix display of dates for drafts and future posts. Props DD32 and ffemtcj. see #5774

git-svn-id: http://svn.automattic.com/wordpress/trunk@6768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-09 08:40:00 +00:00
parent a96ae481ff
commit 62a4e6518b
2 changed files with 18 additions and 8 deletions

View File

@ -128,14 +128,19 @@ addLoadEvent(focusit);
<?php
if ($post_ID):
if ( 'future' == $post->post_status )
if ( 'future' == $post->post_status ) {
$time = __('Scheduled for:<br />%1$s at %2$s');
else if ( 'publish' == $post->post_status )
$date = $post->post_date;
} else if ( 'publish' == $post->post_status ) {
$time = __('Published on:<br />%1$s at %2$s');
else
$date = $post->post_date;
} else {
$time = __('Saved on:<br />%1$s at %2$s');
$date = $post->post_modified;
}
?>
<p><?php printf($time, mysql2date(get_option('date_format'), $post->post_date), mysql2date(get_option('time_format'), $post->post_date)); ?>
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
<?php endif; ?>
</div>

View File

@ -93,14 +93,19 @@ addLoadEvent(focusit);
<?php
if ($post_ID):
if ( 'future' == $post->post_status )
if ( 'future' == $post->post_status ) {
$time = __('Scheduled for:<br />%1$s at %2$s');
else if ( 'publish' == $post->post_status )
$date = $post->post_date;
} else if ( 'publish' == $post->post_status ) {
$time = __('Published on:<br />%1$s at %2$s');
else
$date = $post->post_date;
} else {
$time = __('Saved on:<br />%1$s at %2$s');
$date = $post->post_modified;
}
?>
<p><?php printf($time, mysql2date(get_option('date_format'), $post->post_date), mysql2date(get_option('time_format'), $post->post_date)); ?>
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
<?php endif; ?>
</div>