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 parseMembershipCard(code) {
0007     console.log(code);
0008     const c = code.split(/;/);
0009     let card = {
0010         '@type': 'ProgramMembership',
0011         programName: 'DJH Mitgliedskarte (' + c[10] + ')',
0012         membershipNumber: c[0].substr(1),
0013         member: {
0014             '@type': 'Person',
0015             givenName: c[2],
0016             familyName: c[3],
0017         },
0018         token: 'dataMatrix:' + code,
0019         validFrom: JsonLd.toDateTime(c[12], 'dd.MM.yyyy?', 'de'),
0020         validUntil: JsonLd.toDateTime(c[11], 'MM/yyyy', 'de'),
0021     };
0022     return card;
0023 }