File indexing completed on 2024-12-29 04:51:02

0001 /*
0002    SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
0003    SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 function parseReservation(pass, node) {
0007     var res = node.result[0];
0008     res.reservationFor.name = pass.field['valid-locations'].value;
0009     res.reservationFor.startDate = pass.field['valid-date'].value;
0010     const endTime = pass.field['valid-time-range'].value.match(/-(\d+):(\d+)/);
0011     var endDt = pass.field['valid-date'].value;
0012     endDt.setHours(endTime[1]);
0013     endDt.setMinutes(endTime[2]);
0014     res.reservationFor.endDate = endDt;
0015     res.reservationFor.url = pass.field['website'].value;
0016     res.reservedTicket.name = pass.field['title'].value;
0017     res.underName = JsonLd.newObject("Person");
0018     res.underName.name = pass.field['customer_name'].value;
0019     return res;
0020 }