Skip to content

Commit

Permalink
Change dateParts to be more descriptive
Browse files Browse the repository at this point in the history
Co-authored-by: Aponia <[email protected]>
  • Loading branch information
pinapelz and ap0nia committed May 24, 2024
1 parent ee0874a commit 0d50d4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/antalmanac/src/lib/enrollmentHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export class DepartmentEnrollmentHistory {
for (const enrollmentHistory of res) {
const enrollmentDays: EnrollmentHistoryDay[] = [];

for (const [i, date] of enrollmentHistory.dates.entries()) {
const dateParts = date.split('-');
const d = new Date(Number(dateParts[0]), Number(dateParts[1]), Number(dateParts[2]));
const formattedDate = `${d.getMonth()}/${d.getDate() - 1}/${d.getFullYear()}`;
for (const [i, dateString] of enrollmentHistory.dates.entries()) {
const [day = '', month = '', year = ''] = dateString.split('-');
const date = new Date(Number(day), Number(month), Number(year));
const formattedDate = `${date.getMonth()}/${date.getDate() - 1}/${date.getFullYear()}`;

enrollmentDays.push({
date: formattedDate,
Expand Down

0 comments on commit 0d50d4f

Please sign in to comment.