|
42 | 42 | </div> |
43 | 43 | <?php endif;?> |
44 | 44 | <p>Below are upcoming events relevant to our community.</p> |
45 | | - |
| 45 | +<?php if ($canCreate) : ?> |
| 46 | + <a href="<?php echo Route::_('index.php?option=com_ccpbiosim&task=eventform.edit&id=0', false, 0); ?>" |
| 47 | + class="btn btn-success btn-small"><i |
| 48 | + class="icon-plus"></i> |
| 49 | + <?php echo Text::_('COM_CCPBIOSIM_ADD_ITEM'); ?></a> |
| 50 | +<?php endif; ?> |
46 | 51 | <!-- Main Content --> |
47 | 52 | <div class="container my-5"> |
48 | 53 | <div class="accordion" id="eventsAccordion"> |
|
61 | 66 | <a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>" |
62 | 67 | class="list-group-item list-group-item-action d-flex align-items-start gap-3"> |
63 | 68 | <div class="events-date bg-success text-white"> |
64 | | - <div class="month">Apr</div> |
65 | | - <div class="day">2</div> |
66 | | - <div class="year">2026</div> |
| 69 | + <div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div> |
| 70 | + <div class="day"> |
| 71 | + <?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?> |
| 72 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?> |
| 73 | + <?php else: ?> |
| 74 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?> |
| 75 | + <?php endif; ?> |
| 76 | + </div> |
| 77 | + <div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div> |
67 | 78 | </div> |
68 | 79 | <div> |
69 | 80 | <h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6> |
@@ -92,9 +103,15 @@ class="list-group-item list-group-item-action d-flex align-items-start gap-3"> |
92 | 103 | <a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>" |
93 | 104 | class="list-group-item list-group-item-action d-flex align-items-start gap-3"> |
94 | 105 | <div class="events-date bg-primary text-white"> |
95 | | - <div class="month">Apr</div> |
96 | | - <div class="day">2</div> |
97 | | - <div class="year">2026</div> |
| 106 | + <div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div> |
| 107 | + <div class="day"> |
| 108 | + <?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?> |
| 109 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?> |
| 110 | + <?php else: ?> |
| 111 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?> |
| 112 | + <?php endif; ?> |
| 113 | + </div> |
| 114 | + <div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div> |
98 | 115 | </div> |
99 | 116 | <div> |
100 | 117 | <h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6> |
@@ -123,9 +140,15 @@ class="list-group-item list-group-item-action d-flex align-items-start gap-3"> |
123 | 140 | <a href="<?php echo Route::_('index.php?option=com_ccpbiosim&view=event&id='.(int) $item->id); ?>" |
124 | 141 | class="list-group-item list-group-item-action d-flex align-items-start gap-3"> |
125 | 142 | <div class="events-date bg-warning text-white"> |
126 | | - <div class="month">Apr</div> |
127 | | - <div class="day">2</div> |
128 | | - <div class="year">2026</div> |
| 143 | + <div class="month"><?php echo Factory::getDate($item->startdatetime)->format("M"); ?></div> |
| 144 | + <div class="day"> |
| 145 | + <?php if (Factory::getDate($item->startdatetime)->__get("day") == Factory::getDate($item->enddatetime)->__get("day")): ?> |
| 146 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?> |
| 147 | + <?php else: ?> |
| 148 | + <?php echo Factory::getDate($item->startdatetime)->__get("day"); ?>-<?php echo Factory::getDate($item->enddatetime)->__get("day"); ?> |
| 149 | + <?php endif; ?> |
| 150 | + </div> |
| 151 | + <div class="year"><?php echo Factory::getDate($item->startdatetime)->__get("year"); ?></div> |
129 | 152 | </div> |
130 | 153 | <div> |
131 | 154 | <h6 class="mb-1"><?php echo $this->escape($item->title); ?></h6> |
|
0 commit comments