summaryrefslogtreecommitdiff
path: root/smartyplugins/modifier.bit_short_datetime.php
blob: bc5aee91696211b4b20c3f2fd442bda9d7bdc3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * required setup
 */
global $gBitSmarty;
require_once $gBitSmarty->_get_plugin_filepath( 'modifier', 'bit_date_format' );

/**
 * smarty_modifier_bit_short_datetime
 */
function smarty_modifier_bit_short_datetime( $pString, $time='' ) {
	global $gBitSystem;
	if( !empty( $time ) && date( 'Ymd' ) == date( 'Ymd', $pString )) {
		return smarty_modifier_bit_date_format( $pString, $gBitSystem->get_short_time_format(), '%H:%M %Z' );
	} else {
		return smarty_modifier_bit_date_format( $pString, $gBitSystem->get_short_datetime_format(), '%a %d of %b, %Y (%H:%M %Z)' );
	}
}
?>