tinovyatkin / pass-js

Apple Wallet Passes generating library for Node.JS
MIT License
676 stars 81 forks source link

TextAlignment of FieldDescriptor doesn't work on boarding pass #629

Open pawelkiszka opened 1 year ago

pawelkiszka commented 1 year ago

It seems that textAlignment property of FieldDescriptor type doesn't work (or I'm using it in wrong way). I'm trying to align two values to the left, but my changes are not visible on the boarding pass The template (kept only important bits):

new Template(
  'boardingPass',
  {
    // omitted required fields like 'organizationName'
    boardingPass: {
      // omitted transitType, headerFields, primaryFields, secondaryFields
      auxiliaryFields: [
        {
          key: 'departureDate',
          label: 'DATE',
          value: '13MAR23',
        },
        {
          key: 'board',
          label: 'BOARD',
          value: '22:30'
        },
        {
          key: 'departureTime',
          label: 'DEPARTURE',
          value: '23:00',
          textAlignment: 'PKTextAlignmentLeft' //assuming this should move value to the left
        },
        {
          key: 'arrivalTime',
          label: 'ARRIVAL',
          value: '01:30',
          textAlignment: 'PKTextAlignmentLeft'
        }
      ]
    }
  }
  );

Actual output: image

Expected output: I would like the '23:00' value under 'DEPARTURE' to be aligned to the left, but it's kept to the right. Any help would be appreciated.