-
Notifications
You must be signed in to change notification settings - Fork 168
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
[fix] Instance of 'TZDateTime' #225
[fix] Instance of 'TZDateTime' #225
Conversation
@Akshatji800 can you please review this |
Hmm but what is the actual use case. When shall it be scheduled? What shall the notification show? |
@Akshatji800 The issue labeled #192 requires a solution to address the problem. I am providing an answer that resolves your query. Here is my response. Use Case: Group Travel and Hiking Coordination
In summary, the Beacon project ensures seamless communication, safety, and navigation for group travelers and hikers. By following the beacon, lost members can quickly find their way back to the group, enhancing the overall journey. 🌟 |
@vkprogrammer-001 , we're currently subtracting one hour to schedule the second notification. However, it's crucial to check if the scheduled time is after the current time before proceeding with scheduling. If the scheduled time is after the current time, we'll proceed with the scheduling. Please review this logic again. #224 you can understand from this |
Fixes #192
Issue Description:
When using the
.subtract(Duration(hours: 1))
method to calculate thescheduledDate
, an error occurs: "Exception: Invalid argument (scheduledDate): Must be a date in the future: Instance of 'TZDateTime'." The issue arises because the adjustedscheduledDate
is not in the future.Root Cause:
The subtraction of one hour from the original
scheduledDate
results in a value that is not ahead of the current time.Proposed Solution:
To resolve this issue, I have modified the code to ensure that the
scheduledDate
is always in the future. Instead of subtracting an hour, we can directly use the originalscheduledDate
.Updated Code:
By removing the
.subtract(Duration(hours: 1))
part, we avoid the error and ensure that thescheduledDate
remains in the future.