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

Implement the midnight delay option (alternative) #739

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

hiqua
Copy link
Collaborator

@hiqua hiqua commented Jan 27, 2021

Closes #694.

Follow-up from #717: I think it actually makes sense to tell the user that the app will have to restart for the setting to take effect, and keep the implementation clean, given that users will probably not tick the setting on and off regularly anyway. That would be this PR.

Let me know if I should go back to the previous one and make sure the setting applies right away.

@hiqua hiqua changed the title Implement the midnight delay option Implement the midnight delay option (alternative) Jan 27, 2021
@hiqua hiqua mentioned this pull request Jan 27, 2021
@iSoron iSoron merged commit bb8d4ab into iSoron:dev Jan 28, 2021
@iSoron
Copy link
Owner

iSoron commented Jan 28, 2021

Thanks! I have merged it for now. We can improve it in the future.

The fundamental issue here is that many objects throughout the application are querying the current date by communicating directly with DateUtils. Ideally, I think every object that requires the current date should receive it from whoever instantiated it, and only the entry points (activity.onCreate) should have access to the actual system date. I have already started this refactoring a while ago by removing the concept of "today" from all classes in uhabits.core.models, but we still have a long way to go.

@hiqua hiqua deleted the midnight_delay_option_2 branch January 28, 2021 07:52
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.

Make delayed midnight an opt-in feature
2 participants