Skip to content

Commit a6ede4a

Browse files
committed
Simplifying logic further
1 parent 2d1a49b commit a6ede4a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/infrastructure/gateway/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ const zeroPadNumber = (input: string = ""): string => {
3535
const isDateValid = (date: string): boolean => {
3636
const [year, month, day] = date.split("-");
3737

38-
// Check length constraints and numeric validity
39-
const isDayInvalid = day.length === 0 || day.length > 2 || isNaN(parseInt(day));
40-
const isMonthInvalid = month.length === 0 || month.length > 2 || isNaN(parseInt(month));
38+
const isDayInvalid = day.length > 2 || isNaN(parseInt(day));
39+
const isMonthInvalid = month.length > 2 || isNaN(parseInt(month));
4140
const isYearInvalid = year.length !== 4 || isNaN(parseInt(year));
4241

4342
if (isDayInvalid || isMonthInvalid || isYearInvalid) {

0 commit comments

Comments
 (0)