@olea-bps/base 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olea-bps/base",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "OLEA base library",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -54,6 +54,14 @@ export default function PublicTransportTicketView() {
54
54
 
55
55
  const [user, login] = useUser();
56
56
  const [ticketBarcode, ticketOwner, ticketValidFrom, ticketValidTo, refreshTicket] = usePublicTransportTicket();
57
+ // Gültikeitsangabem in lokaliesierte Strings umwandeln
58
+ // Es wird immer in deutsche Datumangaben umgewandelt, weil das Deutschlandticket nur in deutschland gültig ist.
59
+ const localizedTicketValidFrom = ticketValidFrom?.isValid
60
+ ? ticketValidFrom?.setLocale('de')?.toLocaleString()
61
+ : null;
62
+ const localizedTicketValidTo = ticketValidTo?.isValid
63
+ ? ticketValidTo?.setLocale('de')?.toLocaleString()
64
+ : null;
57
65
 
58
66
  const [refreshingTicketScrollView, setRefreshingTicketScrollView] = useState(false);
59
67
 
@@ -148,14 +156,18 @@ export default function PublicTransportTicketView() {
148
156
  </Text>
149
157
  {ticketOwner}
150
158
  </Text>
151
- <Text>
152
- <Text
153
- style={styles.infoName}
154
- >
155
- Gültigkeit:
156
- </Text>
157
- {ticketValidFrom} - {ticketValidTo}
158
- </Text>
159
+ {
160
+ localizedTicketValidFrom && localizedTicketValidTo
161
+ ? <Text>
162
+ <Text
163
+ style={styles.infoName}
164
+ >
165
+ Gültigkeit:
166
+ </Text>
167
+ {localizedTicketValidFrom} - {localizedTicketValidTo}
168
+ </Text>
169
+ : null
170
+ }
159
171
  </>
160
172
  : null
161
173
  }