File indexing completed on 2024-12-29 04:51:03
0001 /* 0002 SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org> 0003 SPDX-License-Identifier: LGPL-2.0-or-later 0004 */ 0005 0006 function parsePdfTicket(pdf, node, triggerNode) { 0007 const text = pdf.pages[triggerNode.location].text; 0008 let res = JsonLd.newTrainReservation(); 0009 const trip = text.match(/(\d\d:\d\d) (\S.*) - (\d\d:\d\d) (\S.*) +(\d\d\.\d\d\.\d{4})\n *(\S.*?) /); 0010 res.reservationFor.departureTime = JsonLd.toDateTime(trip[5] + ' ' + trip[1], 'dd.MM.yyyy hh:mm', 'ee'); 0011 res.reservationFor.departureStation.name = trip[2]; 0012 res.reservationFor.arrivalTime = JsonLd.toDateTime(trip[5] + ' ' + trip[3], 'dd.MM.yyyy hh:mm', 'ee'); 0013 res.reservationFor.arrivalStation.name = trip[4]; 0014 res.reservationFor.trainNumber = trip[6]; 0015 res.reservedTicket.ticketToken = 'qrcode:' + triggerNode.content; 0016 return res; 0017 }