HTML-1988 - Setting the timezone were instead of having it already as…#58
Open
icrc-toliveira wants to merge 1 commit intoopenmrs:masterfrom
Open
HTML-1988 - Setting the timezone were instead of having it already as…#58icrc-toliveira wants to merge 1 commit intoopenmrs:masterfrom
icrc-toliveira wants to merge 1 commit intoopenmrs:masterfrom
Conversation
… part of the datetimepicker format would lead to a bug - Changing visit date did not execute this peace of code. - And because of that had no timezone attached - To keep it simple and relying on a single implementation being able to parse the 2 types of dates seems the way to go
This was referenced Oct 21, 2022
Member
|
Thanks @icrc-toliveira ! Lots of complexity going on here regarding datetimepicker. In the PIH EMR, I don't think we ever use the datetimepicker (or if we do, it's very rare) so I don't have a good way to test all this out... hopefully someone else can review, btu if you find no one reviewing and getting back to you, feel free to ping me and I should be able to merge this in. |
|
@dkayiwa given it's been 2 weeks, could you review this? Or do you think we should defer to @mogoodrich? This is on ICRC's blockers list. |
dkayiwa
reviewed
Nov 9, 2022
| df.setLenient(false); | ||
| if (dataType.isDateTime() && uiUtils.convertTimezones() && uiUtils.getClientTimezone() != null) { | ||
| df.setTimeZone(TimeZone.getTimeZone(uiUtils.getClientTimezone())); | ||
| // Datetimepicker can send one of 2 formats "yyyy-MM-dd HH:mm:ss" / "yyyy-MM-dd'T'HH:mm:ss.SSSZ" |
Member
There was a problem hiding this comment.
What are the conditions which lead to the widget sending either of the two formats?
dkayiwa
reviewed
Nov 9, 2022
| } | ||
| catch (DateTimeParseException e) { | ||
| DateFormat df = new SimpleDateFormat(WebConstants.DATE_FORMAT_DATETIME); | ||
| df.setLenient(false); |
Member
There was a problem hiding this comment.
Did you intentionally leave out df.setTimeZone()?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue: https://issues.openmrs.org/browse/RA-1988
Description:
When using a date time picker (with time), it will not store the date with time-zone information.
Problem:
Related PR's: