-
Notifications
You must be signed in to change notification settings - Fork 488
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
Changed to current date time instead of date time at which app was loaded. #6791
Merged
khavinshankar
merged 9 commits into
ohcnetwork:develop
from
shyamprakash123:ChangedToCurrentDateTime#6751
Jan 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2d24c63
Changed to current date time instead of date time at which app was lo…
shyamprakash123 c54f092
Merge branch 'develop' into ChangedToCurrentDateTime#6751
shyamprakash123 206266e
Changed to encounter_date
shyamprakash123 2dd7c32
Merge branch 'develop' into ChangedToCurrentDateTime#6751
shyamprakash123 9c3cfd7
removed console.log()
shyamprakash123 0f0d5d5
Merge branch 'develop' into ChangedToCurrentDateTime#6751
nihal467 5832ab6
Merge branch 'develop' into ChangedToCurrentDateTime#6751
nihal467 9128782
modified FLAKY TEST
nihal467 0c5a72b
Merge branch 'develop' into ChangedToCurrentDateTime#6751
shyamprakash123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be quite similar, this date would be generated when the component is initialized, i.e., if a user opens the form and moves away for some reason, this wouldn't be accurate if time is tracked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do this while submitting, something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khavinshankar but the user should be able to see the current date and time in the field of date of admission rather than the date at which the app was loaded. The user can also edit the date so if we take the
new Date()
when onSubmit then there will be no use of the custom date field which is displayed to the user.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He meant more like:
And in the date time input field, you can have something like this to always show current time while the form state's admission_date being null. It would be non-null only when
onChange
is triggered.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khavinshankar but I don't think that's a good way. It could mess up with the draft forms right?
Say the user wanted to create an admission consultation at 11 AM. But had to put the app in background for some reason, bought the app back, form drafts restored the form, but the form drafts would have saved
admission_date
as null. This would cause the admission date to be time at which the submit button was clicked although user may not have intended that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rithviknishad @khavinshankar can you suggest me the final changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khavinshankar @Ashesh3 final changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be left to be done on component mount, so that drafts play nice with it. In any case, the user should correctly set and verify the admission date before submission. I do see the issue of the "time" part not being pin point accurate in this solution, but it's manually configurable and they do see it while filling out the form. (correct me here if admission_date is a hidden field)
cc: @rithviknishad @khavinshankar