From 24ccbf0ee8e5eeac3894470e9b66bca92f3b92ad Mon Sep 17 00:00:00 2001 From: Ali Ramazani Date: Sat, 7 Sep 2024 18:10:29 -0400 Subject: [PATCH 1/3] fixed event date course offering datepicker --- app/static/js/createEvents.js | 16 ++++++++++++++++ app/templates/admin/createEvent.html | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 676804afa..4e9464c2d 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -178,6 +178,22 @@ $(document).ready(function() { $("#checkBonners").prop('checked', true); } } + +// Initialize datepicker for multiple offering modal +$(".multipleOfferingDatePicker").datepicker({ + dateFormat: 'mm/dd/yy', + minDate: new Date(), + onSelect: function() { + $(this).focus(); + } +}); + +$(document).on('click', '.input-group-text, .multipleOfferingDatePicker', function (e) { + // Prevent click from showing datepicker when it's not the datepicker or calendar icon + e.stopPropagation(); + $(this).closest('.input-group').find('.multipleOfferingDatePicker').datepicker('show'); +}); + // Initialize datepicker with proper options $.datepicker.setDefaults({ dateFormat: 'yy/mm/dd', // Ensures compatibility across browsers diff --git a/app/templates/admin/createEvent.html b/app/templates/admin/createEvent.html index 1a468a8bb..b01f899f8 100644 --- a/app/templates/admin/createEvent.html +++ b/app/templates/admin/createEvent.html @@ -480,12 +480,17 @@ Date
- +
+ +
+