This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note that this has some limitations, such as looking specifically for adult tickets, | |
// looking for the given days only in the nearest month that has availability, | |
// and always choosing the earliest time if several are found within the desired dates. | |
function setAdultTickets(adultTicketsWanted) { | |
const adultTicketsCount = parseInt($('.quantity-control.row > input')[0].value, 10); | |
const ticketChangeIterations = Math.abs(adultTicketsWanted - adultTicketsCount); | |
const ticketChangeButton = $(`.quantity-control.row > button.typcn-${adultTicketsCount < adultTicketsWanted ? 'plus' : 'minus'}`)[0]; | |
for (let i = 0; i < ticketChangeIterations; i++) { |