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

Add min and max limitations for IonDateTime #189

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

imblowfish
Copy link
Collaborator

Closed #153

Now the maximum value is equals to current month
The minimum value is calculated based on the following logic. We getting first date of the first period and if this date is further than 6 months from today then this date will be min limitation, if this date is nearest than 6 months then 6 months from today will be the minimum for the IonDateTime

@imblowfish imblowfish added this to the v2.3.6 milestone Nov 22, 2023
@imblowfish imblowfish self-assigned this Nov 22, 2023
Copy link
Owner

@IraSoro IraSoro left a comment

Choose a reason for hiding this comment

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

I think the logic should be a little different.

  1. Check out the past issue: More future periods marked #181. Now in the "Calendar View" we display 6 future cycles (if there are more than 1 cycles). Now this logic works only for a Welcome Modal.
  2. I think the min date should start from the 1st of the month. The max date must end with the last day of the month.

@imblowfish
Copy link
Collaborator Author

I think the logic should be a little different.

  1. Check out the past issue: More future periods marked #181. Now in the "Calendar View" we display 6 future cycles (if there are more than 1 cycles). Now this logic works only for a Welcome Modal.
  2. I think the min date should start from the 1st of the month. The max date must end with the last day of the month.

Agree, logic is changed
Now in the Welcome modal the min date is the start of the month for 6 months earlier than today
In the view calendar mode as min we using date which either for 6 months earlier than today or the first day of month when the first period was marked. max value is either end of the month which 6 months later than today or end of the month for which we have forecast period
In the edit mode the min value is the start of the month for a day which 6 months earlier than today or the first day of the month for which we have marked period. The max value is still today

IraSoro
IraSoro previously approved these changes Nov 29, 2023
Copy link
Owner

@IraSoro IraSoro left a comment

Choose a reason for hiding this comment

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

Do you like the idea of making the display go back 6 cycles only for "Edit Calendar" mode? but in "View Calendar" mode display only marked days.

@imblowfish
Copy link
Collaborator Author

Do you like the idea of making the display go back 6 cycles only for "Edit Calendar" mode? but in "View Calendar" mode display only marked days.

I agree with idea to show only marked days in the view mode, but I didn't understand the point to show only 6 cycles in the edit mode. In my opinion user should be able to mark any day if their forgot to mark period days on the welcome modal. And even in this case user should be able to mark any day in the range of 6 months back started from today to add additional periods.

In my opinion it would be better to leave 6 months/last periods in the edit mode as it works now

@IraSoro
Copy link
Owner

IraSoro commented Nov 29, 2023

Do you like the idea of making the display go back 6 cycles only for "Edit Calendar" mode? but in "View Calendar" mode display only marked days.

I agree with idea to show only marked days in the view mode, but I didn't understand the point to show only 6 cycles in the edit mode. In my opinion user should be able to mark any day if their forgot to mark period days on the welcome modal. And even in this case user should be able to mark any day in the range of 6 months back started from today to add additional periods.

In my opinion it would be better to leave 6 months/last periods in the edit mode as it works now

Yes, I agree

@imblowfish
Copy link
Collaborator Author

Do you like the idea of making the display go back 6 cycles only for "Edit Calendar" mode? but in "View Calendar" mode display only marked days.

I agree with idea to show only marked days in the view mode, but I didn't understand the point to show only 6 cycles in the edit mode. In my opinion user should be able to mark any day if their forgot to mark period days on the welcome modal. And even in this case user should be able to mark any day in the range of 6 months back started from today to add additional periods.
In my opinion it would be better to leave 6 months/last periods in the edit mode as it works now

Yes, I agree

Done

@IraSoro IraSoro force-pushed the 153-set-min-and-max-months-on-datetime branch from 0beb29d to fa80caf Compare November 30, 2023 16:46
@IraSoro IraSoro merged commit 08a44c8 into master Nov 30, 2023
2 checks passed
@IraSoro IraSoro deleted the 153-set-min-and-max-months-on-datetime branch November 30, 2023 16:49
@imblowfish
Copy link
Collaborator Author

I'll leave this comment here, after we already closed this PR

In this PR I cherry-picked some changes from another PR. thought that #187 will be merged before this PR, but we merged this commit earlier instead. Based on this #187 is not actual anymore and doesn't have any changes to project which we can merge. So, I closed the #187 PR and decided to leave this comment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants