Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

timezone conversion support for Rest-API #189

Merged
merged 27 commits into from
Dec 31, 2021
Merged

timezone conversion support for Rest-API #189

merged 27 commits into from
Dec 31, 2021

Conversation

rkrenn
Copy link
Collaborator

@rkrenn rkrenn commented Dec 6, 2021

so far, the implementation uses the UserTimezone setting in the JSF UI layer only:

  • the database contains values in application timezone (eg. UTC)
  • forward: datetime values are converted into UserTImezone when dispalying it in the UI
  • backward: entered values are converted back from UserTimezon into application timezone

so the proper solution here is to complete the implementation:

  • implement the forward timezone conversion also in the PDF renderers
  • implement the forward timezone conversion also in the Excel renderers
  • implement the forward timezone conversion also for the rest-api response objects (to have it in the exports as desired)

this change addresses point 3 above, the timezone conversion when using the Rest-API, eg. for eCRF data exports.

the timezone conversion can be enabled by providing the optional "?tz=" query parameter in the request URLs, eg. "?tz=America/Chicago":

  • date fields of Json request bodies will be read as America/Chicago time, and converted to the application timezone when persisting the value in the database.
  • date fields of Json response objects will be printed in America/Chicago time

For eCRF/Inquiry/SubjectListAttribute input, the the timezone conversion can be controlled by the inputfield's "User Timezone" flag (the above conversion is done only if ticked).

finally also UIdatatable&rest-api items filtering is improved:

  • apply timezone also to filter values
  • support filtering for datetime values (more narrow than just from start-of-day till end-of-day)
  • support filtering for encrypted date values (eg. subject DoB)

@rkrenn rkrenn requested a review from codonAG2 December 6, 2021 07:10
@rkrenn rkrenn linked an issue Dec 6, 2021 that may be closed by this pull request
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 79 Code Smells

0.0% 0.0% Coverage
3.9% 3.9% Duplication

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phoenix CTMS Server time zone
1 participant