Skip to content

Commit

Permalink
Add birthday to RFID assign screen (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramvankooten authored Feb 27, 2020
1 parent 82c73f2 commit 8be54b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lancie-admin-rfid/lancie-admin-rfid-assign.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<lancie-admin-page-layout endpoint="Assign RFID">
<p>Check in a user by scanning the RFID tag and selecting the user from the list below.</p>
<p>Check if the persons birthday is correct, they can't change it after they are checked in.</p>
<paper-button on-tap="_registerUser">Check in</paper-button>
<lancie-error id="error"></lancie-error>
<paper-input id="rfid" label="RFID" value="{{rfid}}" on-keyDown="_focusUser" autofocus></paper-input>
Expand All @@ -54,7 +55,7 @@
<paper-listbox selected="{{ticketId}}" attr-for-selected="ticket-id">
<template is="dom-repeat" items="[[_filter(tickets, filterString)]]">
<paper-item ticket-id="[[item.id]]">
[[item.owner.profile.firstName]] [[item.owner.profile.lastName]]
[[item.owner.profile.firstName]] [[item.owner.profile.lastName]] ([[getDateFormatted(item.owner.profile.birthday)]])
</paper-item>
</template>
</paper-listbox>
Expand Down Expand Up @@ -133,6 +134,12 @@
this.displayColor = true;
},

getDateFormatted:function(date) {
const d = new Date(date);
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
return `${d.getDate()} ${months[d.getMonth()]} ${d.getFullYear()}`;
},

_filter: function(data, filterString) {
if (!filterString) return data;
var result = data.filter(function(ticket) {
Expand Down

0 comments on commit 8be54b8

Please sign in to comment.