| 1 |
<?php |
| 2 |
|
| 3 |
$unq_class = mt_rand(100000, 999999); |
| 4 |
$blockuniqueclass = ''; |
| 5 |
if (!empty($attributes['uniqueClass'])) { |
| 6 |
$blockuniqueclass = $attributes['uniqueClass']; |
| 7 |
} else { |
| 8 |
$blockuniqueclass = 'blockspare-date-time-' . $unq_class; |
| 9 |
} |
| 10 |
|
| 11 |
$wrapperClass = $blockuniqueclass; |
| 12 |
$mainClass = $attributes['layoutOption'] . ' ' . $attributes['layoutType'] . ' ' . $attributes['dateOrder'] . ' bs-date-time-' . $attributes['sectionAlign'] . ' '; |
| 13 |
$mainClass .= $attributes['borderRadius']; |
| 14 |
if ($attributes['animation']) { |
| 15 |
$mainClass .= ' blockspare-block-animation '; |
| 16 |
} else { |
| 17 |
$mainClass .= ' '; |
| 18 |
} |
| 19 |
$mainClass .= $attributes['animation'] . ' ' . $attributes['blockHoverEffect']; |
| 20 |
|
| 21 |
$separator = ','; |
| 22 |
|
| 23 |
$alignclass = blockspare_checkalignment($attributes['align'], $attributes); |
| 24 |
|
| 25 |
$dateClass = 'bs-date-time bs-date-wrapper blockspare-hover-item'; |
| 26 |
if ($attributes['layoutOption'] == 'date-time-style-1') { |
| 27 |
$dateClass .= ' blockspare-hover-text '; |
| 28 |
} |
| 29 |
|
| 30 |
$timeClass = 'bs-date-time bs-time-wrapper blockspare-hover-item'; |
| 31 |
if ($attributes['layoutOption'] == 'date-time-style-1') { |
| 32 |
$timeClass .= ' blockspare-hover-text '; |
| 33 |
} |
| 34 |
$date_format = date_i18n(get_option('date_format'), current_time('timestamp')); |
| 35 |
?> |
| 36 |
|
| 37 |
<div class="<?php echo esc_attr($wrapperClass); ?> align<?php echo esc_attr($alignclass) ?>"> |
| 38 |
<?php echo blockspare_date_time_style_control($blockuniqueclass, $attributes); ?> |
| 39 |
<div class="bs-date-time-widget <?php echo esc_attr($mainClass); ?>" bs-isenabled="<?php echo esc_attr($attributes['time']); ?>" bs-format="<?php echo esc_html($date_format); ?>"> |
| 40 |
<?php if ($attributes['date']) { ?> |
| 41 |
<div class="<?php echo esc_attr($dateClass); ?>"> |
| 42 |
<?php if ($attributes['dateIconToggle']) { ?> |
| 43 |
<div class='bs-icon-wrapper'> |
| 44 |
<i class="bs-date-icon <?php echo esc_attr($attributes['dateIcon']); ?>" aria-hidden="true"></i> |
| 45 |
</div> |
| 46 |
<?php } ?> |
| 47 |
|
| 48 |
<div class="bs-date"> |
| 49 |
<?php if ($attributes['textBeforeDate'] != '') { ?> |
| 50 |
<span class="bs-before-date-text"> |
| 51 |
<?php echo esc_html($attributes['textBeforeDate']); ?> |
| 52 |
</span> |
| 53 |
<?php } ?> |
| 54 |
|
| 55 |
<time class="bs-date-text" datetime="2025-10-27" aria-label="<?php echo esc_attr($date_format); ?>"> |
| 56 |
<?php echo esc_html($date_format); ?> |
| 57 |
</time> |
| 58 |
<?php if ($attributes['textAfterDate'] != '') { ?> |
| 59 |
<span class="bs-after-date-text"> |
| 60 |
<?php echo esc_html($attributes['textAfterDate']); ?> |
| 61 |
</span> |
| 62 |
<?php } ?> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
<?php } ?> |
| 66 |
|
| 67 |
<div class="<?php echo esc_attr($timeClass); ?>" bs-isenabled="<?php echo esc_attr($attributes['time']); ?>" bs-format="<?php echo esc_html($date_format); ?>" id="bs-date-time"> |
| 68 |
<?php |
| 69 |
|
| 70 |
if ($attributes['time']) { |
| 71 |
if ($attributes['timeIconToggle']) { ?> |
| 72 |
<div class="bs-icon-wrapper"> |
| 73 |
<i class="bs-time-icon <?php echo esc_attr($attributes['timeIcon']) ?>" aria-hidden="true"></i> |
| 74 |
</div> |
| 75 |
<?php } |
| 76 |
} ?> |
| 77 |
<span class="bs-time-text"></span> |
| 78 |
</div> |
| 79 |
|
| 80 |
|
| 81 |
</div> |
| 82 |
</div> |
| 83 |
<?php |
| 84 |
|