Infer timezone in DateTime field handler #126
Merged
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.
I thought I had already made PR for this but I can't find it, forgive me if I'm being foolish.
Currently the following scenario will fail most of the time:
It will typically fail because values are by default created and stored using UTC, but rendered using the current user's timezone. The workaround is for step authors to do mental time math, writing their "Given" times in UTC and their "Then" times in the Drupal timzeone (which is the default for any user).
I think we should assume that step authors intend time values to be in the Drupal default timezone when they write them in Given statements, unless they explicitly specify a timezone.
This will break BC for anyone writing tortured scenarios expecting the current behavior.
I can write some tests for it in the extension, if you like the idea of this.