Make text_datetime_timestamp_timezone save the correct Datetime object #1468
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.
Description
Add the timezone offset on the saved Datetime object and remove it on field load.
Note: this PR needs improvement (see high risk below)
Motivation and Context
Currently, the timezone offset is only applied to the UTC saved date. This PR applies the offset on the stored Datetime object as well.
Fixes #1465
Risk Level
Low risk - small changes, all related to the text_datetime_timestamp_timezone field.
High risk that needs to be resolved: Existing data will also receive an offset modification on field load. This means the input value changes when the user loads the page, the new value is saved when the user saves the page.
Testing procedure
The code sample below shows the issue:
Types of changes
Checklist:
Screenshots
Screenshot of UTC saved date and saved object after save in the current develop branch:
Screenshot of UTC saved date and saved object after save in this branch: