-
Notifications
You must be signed in to change notification settings - Fork 60
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
HTML-1988 - Setting the timezone were instead of having it already as… #58
base: master
Are you sure you want to change the base?
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
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. |
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" |
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.
What are the conditions which lead to the widget sending either of the two formats?
} | ||
catch (DateTimeParseException e) { | ||
DateFormat df = new SimpleDateFormat(WebConstants.DATE_FORMAT_DATETIME); | ||
df.setLenient(false); |
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.
Did you intentionally leave out df.setTimeZone()
?
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: