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

Edit Mark Modal UI #104

Merged
merged 9 commits into from
Sep 1, 2023
Merged

Edit Mark Modal UI #104

merged 9 commits into from
Sep 1, 2023

Conversation

IraSoro
Copy link
Owner

@IraSoro IraSoro commented Aug 31, 2023

Closed #94

I changed the ui. Now it looks like this
image

I also moved all calculations to the CalculationLogics.ts.
I created getPastFuturePeriodDays function. In the Mark Modal, in the value property, I need to transfer all the past period days and the marked current ones. I already have a function for calculating past days - getLastPeriodDays. But for the Mark Modal, I also need to pass the estimated values of the marked periods. That's why I created the getPastFuturePeriodDays function. In it, I first call a getLastPeriodDays function to pass the days of the past period, and then I count the current ones.

Now I also updated storage using getNewCyclesHistory. It is past function.

I created a new function to set active dates specifically for Mark Modal - getMarkModalActiveDates. However, there is already a similar getActiveDates function but with an additional condition. I don't know how to fix it.

@IraSoro IraSoro added this to the v2.3.0 milestone Aug 31, 2023
@IraSoro IraSoro self-assigned this Aug 31, 2023
Copy link
Collaborator

@imblowfish imblowfish left a comment

Choose a reason for hiding this comment

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

I have one question, but you can fix it by you own

lastCycleFinish.setHours(0, 0, 0, 0);

return date.getTime() > lastCycleFinish.getTime();
const isActiveDates = (date: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need this function? You ca just call function from CalculationLogic instead

Copy link
Owner Author

Choose a reason for hiding this comment

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

These calculations have been moved to CalculationLogic. This function calls the getMarkModalActiveDates function from CalculationLogic.
But after the comment, I removed this function. Now the getMarkModalActiveDates function is calculated directly from

isDateEnabled={(date: string) => {
               return getMarkModalActiveDates(date, cycles);
             }}

@IraSoro IraSoro merged commit fdcb4e5 into master Sep 1, 2023
2 checks passed
@IraSoro IraSoro deleted the 94-edit-mark-modal-ui branch September 1, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Edit Mark Modal ui
2 participants