Skip to content

Commit 64399c7

Browse files
authored
Merge pull request #332 from morganchen12/time-format
fix time format code in phone auth
2 parents c1fac83 + 3212e70 commit 64399c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

FirebasePhoneAuthUI/FUIPhoneVerificationViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ - (void)resendConfirmationCodeTimerFinished {
264264
}
265265

266266
- (void)updateResendLabel {
267-
NSTimeInterval minutes = _resendConfirmationCodeSeconds / 60;
268-
NSTimeInterval seconds = (NSUInteger)_resendConfirmationCodeSeconds % 60;
269-
NSString *formattedTime = [NSString stringWithFormat:@"%01.0f:%02.0f", minutes, seconds];
267+
NSInteger minutes = _resendConfirmationCodeSeconds / 60; // Integer type for truncation
268+
NSInteger seconds = round(_resendConfirmationCodeSeconds % 60);
269+
NSString *formattedTime = [NSString stringWithFormat:@"%ld:%02ld", minutes, seconds];
270270

271271
_resendConfirmationCodeTimerLabel.text =
272272
[NSString stringWithFormat:FUIPhoneAuthLocalizedString(kPAStr_ResendCodeTimer),

0 commit comments

Comments
 (0)