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

git-svn-id: https://develop.svn.wordpress.org/trunk@6768 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-02-09 08:40:00 +00:00
parent 3c1a115108
commit 5deeece50b
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>