flatpickr fix + add end date in slide list
This commit is contained in:
parent
4991f6e2be
commit
745e21d2a3
@ -21,8 +21,10 @@ jQuery(document).ready(function ($) {
|
||||
const loadDateTimePicker = function($els) {
|
||||
$els.each(function() {
|
||||
var $el = $(this);
|
||||
$el.val('');
|
||||
const pickr = $el.flatpickr({
|
||||
if (!$el.val()) {
|
||||
$el.val(prettyTimestamp(Date.now()).slice(0, -4));
|
||||
}
|
||||
$el.flatpickr({
|
||||
enableTime: true,
|
||||
time_24hr: true,
|
||||
allowInput: false,
|
||||
@ -199,7 +201,6 @@ jQuery(document).ready(function ($) {
|
||||
$(document).on('click', '.slide-edit', function () {
|
||||
const slide = JSON.parse($(this).parents('tr:eq(0)').attr('data-entity'));
|
||||
showModal('modal-slide-edit');
|
||||
loadDateTimePicker($('.modal-slide-edit .datetimepicker'))
|
||||
|
||||
const hasCron = slide.cron_schedule && slide.cron_schedule.length > 0;
|
||||
const hasDateTime = hasCron && validateCronDateTime(slide.cron_schedule);
|
||||
@ -233,6 +234,8 @@ jQuery(document).ready(function ($) {
|
||||
hasDateTimeEnd ? getCronDateTime(slide.cron_schedule_end) : ''
|
||||
);
|
||||
$('#slide-edit-id').val(slide.id);
|
||||
loadDateTimePicker($('.modal-slide-edit .datetimepicker'));
|
||||
|
||||
inputSchedulerUpdate();
|
||||
});
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
{% endif %}
|
||||
<th class="tac">{{ l.slideshow_slide_panel_th_enabled }}</th>
|
||||
<th class="">{{ l.slideshow_slide_panel_th_cron_scheduled }}</th>
|
||||
<th class="tac">{{ l.slideshow_slide_panel_th_duration }}</th>
|
||||
<th class="">{{ l.slideshow_slide_panel_th_duration }}</th>
|
||||
<th class="tac">{{ l.slideshow_slide_panel_th_activity }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -74,8 +74,21 @@
|
||||
🔄 {{ l.slideshow_slide_panel_td_cron_scheduled_loop }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="tac">
|
||||
{{ slide.duration }} {{ l.slideshow_slide_panel_th_duration_unit }}
|
||||
<td class="">
|
||||
{% if slide.cron_schedule_end %}
|
||||
{% set cron_desc_end = cron_descriptor(slide.cron_schedule_end) %}
|
||||
{% if cron_desc_end %}
|
||||
{% if is_validate_cron_date_time(slide.cron_schedule_end) %}
|
||||
📆 {{ cron_desc_end }}
|
||||
{% else %}
|
||||
⏳ {{ cron_desc_end }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="error">⚠️ {{ l.slideshow_slide_panel_td_cron_scheduled_bad_cron }}</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
⏱️ {{ slide.duration }} {{ l.slideshow_slide_panel_th_duration_unit }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="actions tac">
|
||||
<a href="javascript:void(0);" class="item-edit slide-edit">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user