Skip to content

Commit

Permalink
Merge branch 'MultipleOfferingEvents' of https://github.com/BCStudent…
Browse files Browse the repository at this point in the history
…SoftwareDevTeam/celts into MultipleOfferingEvents
  • Loading branch information
dixita9 committed Jul 24, 2024
2 parents 3342728 + f2ff5a9 commit fa5358c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def createEvent(templateid, programid):
elif len(savedEventsList) >= 1 and eventData.get('isMultipleOffering'):
modifiedSavedEvents = [item for sublist in savedEventsList for item in sublist]

event_dates = [event_data[0].startDate.strftime('%m/%d/%Y') for event_data in savedEventsList]
event_dates = [datetime.strptime(str(event_data[0].startDate)[:10], '%Y-%m-%d').date().strftime('%m/%d/%Y') for event_data in savedEventsList]

event_list = ', '.join(f"<a href=\"{url_for('admin.eventDisplay', eventId=event.id)}\">{event.name}</a>" for event in modifiedSavedEvents)

Expand Down
3 changes: 1 addition & 2 deletions app/static/js/createEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,12 @@ function calculateRecurringEventFrequency(){
$('#modalMultipleOffering').modal('hide');
msgFlash("Multiple time offering events saved!", "success");
}
});
});
//build multi-event table
function storeMultipleOfferingEventAttributes() {
let entries = [];
$(".extraSlots").children().each(function(index, element) {
let rowData = $.map($(element).find("input"), (el) => $(el).val());

entries.push({
eventName: rowData[0],
eventDate: rowData[1],
Expand Down
4 changes: 2 additions & 2 deletions app/templates/admin/createEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ <h5 class="modal-title">This is an event with multiple time offerings.</h5>
{% else %}
{% set startTime = "12:00" %}
{% endif %}
<input autocomplete="off" type="time" class="form-control timepicker multipleOfferingStartTime" value="{{startTime}}" name="timeStart"
<input autocomplete="off" type="time" class="form-control timepicker" value="{{startTime}}" name="timeStart"
aria-describedby="timeIcon1" placeholder="Pick a start time"
id="multipleOfferingStartTime-{{pageLocation}}" data-page-location="{{pageLocation}}" required />
<span class="input-group-text timeIcons" id="timeIcon1-{{pageLocation}}" hidden><i class="bi bi-clock"></i></span>
Expand All @@ -446,7 +446,7 @@ <h5 class="modal-title">This is an event with multiple time offerings.</h5>
{%else%}
{% set endTime = "13:00" %}
{% endif %}
<input autocomplete="off" type="time" class="form-control timepicker multipleOfferingEndTime" value="{{endTime}}" name="timeEnd"
<input autocomplete="off" type="time" class="form-control timepicker" value="{{endTime}}" name="timeEnd"
aria-describedby="timeIcon2" placeholder="Pick an end time"
id="multipleOfferingEndTime-{{pageLocation}}" data-page-location="{{pageLocation}}" required />
<span class="input-group-text timeIcons" id="timeIcon2-{{pageLocation}}" hidden><i class="bi bi-clock"></i></span>
Expand Down

0 comments on commit fa5358c

Please sign in to comment.