Skip to content

Commit

Permalink
merge #250: createDaysList의 반환 형식 변경 5화 → 05 화
Browse files Browse the repository at this point in the history
[refactor] createDaysList의 반환 형식 변경 5화 → 05 화
  • Loading branch information
yaongmeow authored Dec 5, 2023
2 parents 8581cce + 62cb9ce commit 185e944
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BE/src/postings/postings.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ export class PostingsController {
return Array.from({ length: days }, (_, index) => {
const date = new Date(startDate);
date.setDate(standardDate.getDate() + index);
return `${date.getDate()}${weekdays[date.getDay()]}`;
const stringDate = date.getDate().toString();
return `${stringDate.length < 2 ? `0${stringDate}` : stringDate} ${
weekdays[date.getDay()]
}`;
});
}
}

0 comments on commit 185e944

Please sign in to comment.