Skip to content

Commit

Permalink
convert NSDate to NSString
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Leighton committed Jul 12, 2022
1 parent e3ef3a8 commit f218aa6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ios/RNCardConnectReactLibrary.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,17 @@ - (void)swiperDidStartCardRead:(BMSSwiper *)swiper {

- (void)swiper:(BMSSwiper *)swiper didGenerateTokenWithAccount:(BMSAccount *)account completion:(void (^)(void))completion {

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"mmyy"];

//Optionally for time zone conversions
// [formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]];

NSString *stringFromDate = [formatter stringFromDate:account.expirationDate];

[self sendEventWithName:@"BoltOnTokenGenerated" body:@{
@"token": account.token,
@"expiry": account.expirationDate,
@"expiry": stringFromDate,
@"name": account.name
}];

Expand Down

0 comments on commit f218aa6

Please sign in to comment.