Skip to content

Commit

Permalink
fix: birthdate being wrong format when day is less than 10
Browse files Browse the repository at this point in the history
  • Loading branch information
giuxtaposition committed Mar 28, 2024
1 parent b3db4b7 commit 7f55c33
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/services/fakeDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ class FakeDataService {

const year = date.getUTCFullYear();
let month: number | string = date.getUTCMonth() + 1;
const day = date.getUTCDate();
let day: number | string = date.getUTCDate();

if (day < 10) {
day = "0" + day;
}

if (month < 10) {
month = "0" + month;
Expand All @@ -85,7 +89,11 @@ class FakeDataService {
}

public static phone() {
return "3" + faker.string.numeric({ length: 1, exclude: "0" }) + faker.string.numeric({ length: 8 });
return (
"3" +
faker.string.numeric({ length: 1, exclude: "0" }) +
faker.string.numeric({ length: 8 })
);
}

public static street() {
Expand Down

0 comments on commit 7f55c33

Please sign in to comment.