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
26
27
28
29
30
31
32
33
34
35
36
37
|
<?php
namespace AutomateWoo;
defined( 'ABSPATH' ) || exit;
/** * @var string $date * @var bool $is_gmt * @var bool $shorten_month */
if ( ! isset( $is_gmt ) ) { $is_gmt = true; }
if ( ! isset( $shorten_month ) ) { $shorten_month = false; }
$with_diff = Format::datetime( $date, false, $is_gmt, $shorten_month ); $no_diff = Format::datetime( $date, 0, $is_gmt, $shorten_month ); if ( ! $with_diff ) { echo '-'; return; }
if ( $with_diff === $no_diff ) { echo esc_attr( $with_diff ); return; }
?> <div class="automatewoo-hoverable-date" data-automatewoo-date-with-diff="<?php echo esc_attr( $with_diff ); ?>" data-automatewoo-date-no-diff="<?php echo esc_attr( $no_diff ); ?>" ><?php echo esc_attr( $with_diff ); ?></div>
|