Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group expenses #48

Merged
merged 8 commits into from
Jan 17, 2024
Merged

Conversation

acuteengle
Copy link
Contributor

@acuteengle acuteengle commented Jan 16, 2024

Closes #27

Screen Shot 2024-01-17 at 10 19 17

Copy link

vercel bot commented Jan 16, 2024

@acuteengle is attempting to deploy a commit to the Sebastien Castiel Team on Vercel.

A member of the Team first needs to authorize it.

@scastiel
Copy link
Member

Hi @acuteengle it looks great!

There are some TypeScript errors in your code, could you please fix them? You can run npx tsc --noEmit to see them if you can’t see them in your IDE.

A non-blocking suggestion (I can deal with it after merge): instead of displaying all the dates, maybe we could use groups such as “This week”, “Earlier this month”, “Last month”, “Last year”, “Older”, what do you think?

@acuteengle
Copy link
Contributor Author

There are some TypeScript errors in your code, could you please fix them? You can run npx tsc --noEmit to see them if you can’t see them in your IDE.

Ah thanks! Done!

I also ran npx prettier . --write since I noticed you have a CI check for that as well

return Math.round(differenceInTime / (1000 * 3600 * 24)) // convert milliseconds to days
}

function getExpenseGroup(date: Dayjs, today: Dayjs) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had this:
Screen Shot 2024-01-17 at 10 10 42

But then I realized that the headers were then misleading so I have to actually check if the expense date is in the same week, or month, or year, etc. Because of that, I had to utilize the dayjs package

@acuteengle
Copy link
Contributor Author

@scastiel Ready for another look!

Screen Shot 2024-01-17 at 10 13 49

@acuteengle acuteengle changed the title Group expenses my date Group expenses Jan 17, 2024
@scastiel scastiel merged commit ff6b84f into spliit-app:main Jan 17, 2024
1 of 2 checks passed
@acuteengle acuteengle deleted the group-by-expense-date branch January 17, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Group expenses by date
2 participants