Skip to content

Commit 8c8f4bb

Browse files
committed
fix code format and typo in variable name
1 parent 0b30d95 commit 8c8f4bb

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/components/AddPaymentCard/PaymentCardForm.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,15 @@ function PaymentCardForm({
160160

161161
if (value.length >= 2) {
162162
const month = parseInt(value.slice(0, 2), 10);
163-
164163
if (value.startsWith('00')) {
165164
value = '0';
166165
}
167-
168166
if (month > 12) {
169167
value = `0${value.charAt(0)}${value.charAt(1)}${value.charAt(2)}`;
170168
}
171169
}
172170

173-
const prevValue = previousvalueRef.current?.replace(CONST.REGEX.NON_NUMERIC, '') ?? '';
174-
171+
const prevValue = previousValueRef.current?.replace(CONST.REGEX.NON_NUMERIC, '') ?? '';
175172
let formattedValue = value;
176173

177174
if (value.length === 2 && prevValue.length < 2) {
@@ -180,8 +177,7 @@ function PaymentCardForm({
180177
formattedValue = `${value.slice(0, 2)}/${value.slice(2, 4)}`;
181178
}
182179

183-
previousvalueRef.current = formattedValue;
184-
180+
previousValueRef.current = formattedValue;
185181
setExpirationDate(formattedValue);
186182
}, []);
187183

0 commit comments

Comments
 (0)