From b1934f1dab6bf787b80ba67b38bc82657d41f37e Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Mon, 9 Mar 2026 14:53:21 -0400 Subject: [PATCH 1/9] now the date carries in the weekly series --- app/static/js/createEvents.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 8693dc6cc..643cbdcf1 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -686,6 +686,7 @@ $("#cancelEvent").on('click', function (event) { if ($(this).is(':checked')) { $("#repeatingEventsNamePicker").val($("#inputEventName").val()); $("#repeatingEventsLocationPicker").val($("#inputEventLocation-main").val()); + $("#repeatingEventsStartDate").val($("#startDatePicker-mainOnly").val()); $('.addMultipleOfferingEvent').hide(); $("#repeatingEventsDiv").removeClass('d-none'); $("#multipleOfferingSlots").children().remove(); From 6b57fa142753112431765f09728a3811453571ba Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Fri, 13 Mar 2026 15:05:04 -0400 Subject: [PATCH 2/9] carrying time for the weekly events --- app/static/js/createEvents.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 643cbdcf1..fc51b3b48 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -687,6 +687,8 @@ $("#cancelEvent").on('click', function (event) { $("#repeatingEventsNamePicker").val($("#inputEventName").val()); $("#repeatingEventsLocationPicker").val($("#inputEventLocation-main").val()); $("#repeatingEventsStartDate").val($("#startDatePicker-mainOnly").val()); + $("#repeatingEventsStartTime").val($("#startTime-main").val()); + $("#repeatingEventsEndTime").val($("#endTime-main").val()); $('.addMultipleOfferingEvent').hide(); $("#repeatingEventsDiv").removeClass('d-none'); $("#multipleOfferingSlots").children().remove(); @@ -878,9 +880,4 @@ $("#cancelEvent").on('click', function (event) { }); setCharacterLimit($("#inputCharacters"), "#remainingCharacters"); - }); - - - - - + }); \ No newline at end of file From 4e8868869fa58305a54d9e3e0a892a7b0ca6a049 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Mon, 23 Mar 2026 14:39:17 -0400 Subject: [PATCH 3/9] carried date for occurrences --- app/static/js/createEvents.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index fc51b3b48..7549f8594 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -753,8 +753,10 @@ $("#cancelEvent").on('click', function (event) { $(".addMultipleOfferingEvent").click(function () { // Get the current value from the main location input let mainLocation = $("#inputEventLocation-main").val(); - createOfferingModalRow({ eventLocation: mainLocation }); - }); + let existingRows = $("#multipleOfferingSlots .eventOffering").length; + let mainDate = existingRows === 0 ? $("#startDatePicker-mainOnly").val() : null; + createOfferingModalRow({ eventLocation: mainLocation, eventDate: mainDate }); +}); var minDate = new Date('10/25/1999') $("#startDatePicker-main").datepicker("option", "minDate", minDate) From 00c7bcfa0457ca9e6241801e1cc745ebcb60d6f0 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Mon, 23 Mar 2026 15:26:57 -0400 Subject: [PATCH 4/9] solving the date convertion issue --- app/logic/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logic/events.py b/app/logic/events.py index 05c694719..a9a9e8914 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -120,7 +120,7 @@ def attemptSaveMultipleOfferings(eventData, attachmentFiles = None): # Create separate event data for each event in the series, inheriting from the original eventData - seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(f"{x['eventDate']} {x['startTime']}",'%Y-%m-%d %H:%M')) + seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(f"{x['eventDate']} {x['startTime']}",'%m/%d/%Y %H:%M')) isRepeating = bool(eventData.get('isRepeating')) with mainDB.atomic() as transaction: for index, event in enumerate(seriesData): From 2d35b9e63cb430415b0351db5559807ad9123b47 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Tue, 24 Mar 2026 15:14:24 -0400 Subject: [PATCH 5/9] made the date format more consistent. --- app/logic/events.py | 2 +- tests/code/test_bonner.py | 2 +- tests/code/test_event_list.py | 2 +- tests/code/test_events.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/logic/events.py b/app/logic/events.py index a9a9e8914..24f0bbdee 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -120,7 +120,7 @@ def attemptSaveMultipleOfferings(eventData, attachmentFiles = None): # Create separate event data for each event in the series, inheriting from the original eventData - seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(f"{x['eventDate']} {x['startTime']}",'%m/%d/%Y %H:%M')) + seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(f"{x['eventDate']} {x['startTime']}",'%m/%d/%Y %H:%M')) # sorts the events in the series by date and time so that the events are created in order and the naming convention of Week 1, Week 2, etc. is consistent with the order of the events. isRepeating = bool(eventData.get('isRepeating')) with mainDB.atomic() as transaction: for index, event in enumerate(seriesData): diff --git a/tests/code/test_bonner.py b/tests/code/test_bonner.py index bd84806fd..da691c69c 100644 --- a/tests/code/test_bonner.py +++ b/tests/code/test_bonner.py @@ -113,7 +113,7 @@ def test_addBonnerCohortToRsvpLog(): BonnerCohort.create(user="neillz", year=currentYear) BonnerCohort.create(user="khatts", year=currentYear) - testDate = datetime.strptime("2025-01-19 05:00","%Y-%m-%d %H:%M") + testDate = datetime.strptime("01/19/2025 05:00","%m/%d/%Y %H:%M") # Create a test event associated with a Bonner Scholars program programEvent = Program.create(id = 15, diff --git a/tests/code/test_event_list.py b/tests/code/test_event_list.py index 2fd2ca38e..98d6bd1ab 100644 --- a/tests/code/test_event_list.py +++ b/tests/code/test_event_list.py @@ -77,7 +77,7 @@ def test_getVolunteerOpportunities(training_events): @pytest.mark.integration def test_getUpcomingVolunteerOpportunitiesCount(): with mainDB.atomic() as transaction: - testDate = datetime.strptime("2021-08-01 05:00","%Y-%m-%d %H:%M") + testDate = datetime.strptime("08/01/2021 05:00","%m/%d/%Y %H:%M") currentTestTerm = Term.get_by_id(5) # In case any events are put in term 5 in testData, put them into the past. diff --git a/tests/code/test_events.py b/tests/code/test_events.py index ed153bfbe..687fed4fe 100644 --- a/tests/code/test_events.py +++ b/tests/code/test_events.py @@ -772,7 +772,7 @@ def test_deleteEvent(): @pytest.mark.integration def test_upcomingEvents(): with mainDB.atomic() as transaction: - testDate = datetime.strptime("2021-08-01 05:00","%Y-%m-%d %H:%M") + testDate = datetime.strptime("08/01/2021 05:00","%m/%d/%Y %H:%M") dayBeforeTestDate = testDate - timedelta(days=1) # Create a user to run the tests with @@ -1329,7 +1329,7 @@ def test_inviteCohortsToEvent(): with app.app_context(): g.current_user = "heggens" - testDate = datetime.strptime("2025-08-01 05:00","%Y-%m-%d %H:%M") + testDate = datetime.strptime("08/01/2025 05:00","%m/%d/%Y %H:%M") programEvent = Program.create(id = 13, programName = "Bonner Scholars", isBonnerScholars = True, @@ -1362,7 +1362,7 @@ def test_updateEventCohorts(): with app.app_context(): g.current_user = "heggens" - testDate = datetime.strptime("2025-10-01 05:00","%Y-%m-%d %H:%M") + testDate = datetime.strptime("10/01/2025 05:00","%m/%d/%Y %H:%M") programEvent = Program.create(id = 13, programName = "Bonner Scholars", isBonnerScholars = True, From 12bcc4824ab7c529ea379a7c7ca7ee350f4cd681 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Wed, 25 Mar 2026 15:42:15 -0400 Subject: [PATCH 6/9] fixed the time carrying --- app/static/js/createEvents.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 7549f8594..50f00cb0b 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -755,7 +755,9 @@ $("#cancelEvent").on('click', function (event) { let mainLocation = $("#inputEventLocation-main").val(); let existingRows = $("#multipleOfferingSlots .eventOffering").length; let mainDate = existingRows === 0 ? $("#startDatePicker-mainOnly").val() : null; - createOfferingModalRow({ eventLocation: mainLocation, eventDate: mainDate }); + let mainTime = $("#startTime-main").val(); + let endTime = $("#endTime-main").val(); + createOfferingModalRow({ eventLocation: mainLocation, eventDate: mainDate, startTime: mainTime, endTime: endTime }); }); var minDate = new Date('10/25/1999') From 70b395890c78a740abe71ed42ee63fc40f3cefb1 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Fri, 27 Mar 2026 14:01:45 -0400 Subject: [PATCH 7/9] Parsing the date to format it the way we need --- app/logic/events.py | 5 +++-- app/static/js/createEvents.js | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/logic/events.py b/app/logic/events.py index d51a0b7a6..c89de4031 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -119,8 +119,9 @@ def attemptSaveMultipleOfferings(eventData, attachmentFiles = None): seriesId = calculateNewSeriesId() # Create separate event data for each event in the series, inheriting from the original eventData - - seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(f"{x['eventDate']} {x['startTime']}",'%m/%d/%Y %H:%M')) # sorts the events in the series by date and time so that the events are created in order and the naming convention of Week 1, Week 2, etc. is consistent with the order of the events. + print("seriesData received:", eventData.get('seriesData')) + seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(x['eventDate'].split(' ')[0] + ' ' + x['startTime'], '%Y-%m-%d %H:%M')) + # sorts the events in the series by date and time so that the events are created in order and the naming convention of Week 1, Week 2, etc. is consistent with the order of the events. isRepeating = bool(eventData.get('isRepeating')) with mainDB.atomic() as transaction: for index, event in enumerate(seriesData): diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 50f00cb0b..7128a5042 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -405,8 +405,7 @@ function loadOfferingsToModal() { function loadRepeatingOfferingToModal(offering){ var seriesTable = $("#generatedEventsTable"); - var eventDate = new Date(offering.date || offering.eventDate).toLocaleDateString(); - + var eventDate = offering.date || offering.eventDate; seriesTable.append( "" + @@ -751,7 +750,7 @@ $("#cancelEvent").on('click', function (event) { /*cloning the div with ID multipleOfferingEvent and cloning, changing the ID of each clone going up by 1. This also changes the ID of the deleteMultipleOffering so that when the trash icon is clicked, that specific row will be deleted*/ $(".addMultipleOfferingEvent").click(function () { - // Get the current value from the main location input + // Get the current value from the main location input and the date input let mainLocation = $("#inputEventLocation-main").val(); let existingRows = $("#multipleOfferingSlots .eventOffering").length; let mainDate = existingRows === 0 ? $("#startDatePicker-mainOnly").val() : null; From ebb86aca2d2396be64c1a2dccae032a019533ea4 Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Fri, 27 Mar 2026 14:22:26 -0400 Subject: [PATCH 8/9] date format --- app/static/js/createEvents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index 7128a5042..8e0609633 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -405,7 +405,7 @@ function loadOfferingsToModal() { function loadRepeatingOfferingToModal(offering){ var seriesTable = $("#generatedEventsTable"); - var eventDate = offering.date || offering.eventDate; + var eventDate = formatDate(offering.date || offering.eventDate); seriesTable.append( "" + From 1cfc340fc9c9090c74445090714eed3562ad176f Mon Sep 17 00:00:00 2001 From: bakobagassas Date: Mon, 30 Mar 2026 11:58:52 -0400 Subject: [PATCH 9/9] removing debugging print statement --- app/logic/events.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/logic/events.py b/app/logic/events.py index ad2931d4e..822d85632 100644 --- a/app/logic/events.py +++ b/app/logic/events.py @@ -119,7 +119,6 @@ def attemptSaveMultipleOfferings(eventData, attachmentFiles = None): seriesId = calculateNewSeriesId() # Create separate event data for each event in the series, inheriting from the original eventData - print("seriesData received:", eventData.get('seriesData')) seriesData = sorted(eventData.get('seriesData'), key=lambda x: datetime.strptime(x['eventDate'].split(' ')[0] + ' ' + x['startTime'], '%Y-%m-%d %H:%M')) # sorts the events in the series by date and time so that the events are created in order and the naming convention of Week 1, Week 2, etc. is consistent with the order of the events. isRepeating = bool(eventData.get('isRepeating'))