Advertisement:

Author Topic: [TIP] [UI] only display the Modified date when different of Published one  (Read 742 times)

Emmanuel

  • Hero Member
  • *****
  • Posts: 645
  • .: ♥ Quality Swiss Details ♥ :. .: Swiss Made :.
Better UX: only display the Modified date when different of Published one:

& using your favorites Date & Time formats as defined in General Settings:


Code: [Select]
<?php if ( ($date_pub = osc_item_pub_date()) !== '' ) { 
        echo 
'<strong class="publish">Annonce publiée le '. osc_format_date( $date_pub, osc_date_format().' à '.osc_time_format() ).'</strong>';
}
if ( (
$date_mod = osc_item_mod_date()) != NULL && ($date_mod !== $date_pub) ) { 
        echo 
'<span class="update"> et <strong>modifiée</strong> le '. osc_format_date( $date_mod, osc_date_format().' à '.osc_time_format() ) .'</span>';
} 
?>