-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add human modifier for date and time fields #2131
Add human modifier for date and time fields #2131
Conversation
…g-modifiers-on-all-date-fields
@omarkasem, code looks good, thanks. Could you please add a unit test for this? @Mwalek, please test. |
@omarkasem I think there is a problem with the handling of future dates (see image). Try site: https://diy-issue-248964a.try.gravitykit.com/display-human/ |
@Mwalek, please retest and also try with different timezones. |
@omarkasem @mrcasual future dates are now displayed correctly. As for the timezone, it doesn't matter what is set in WordPress (settings > general), it looks like the server timezone (UTC) is employed. This applies to both comparisons of past and future dates. In the image below, I have the WordPress timezone set to UTC+2, my timezone, so if the human time difference were applying this setting, I would expect to see the next day starting in 2 hours instead of 4 (see image).
|
@omarkasem, you may find this relevant: 2850c35. |
@omarkasem, please see comments above. |
@Mwalek Thanks for the detailed comment, I think the last commit fixed the timezone issue. |
@omarkasem @mrcasual I confirmed that the timezone issue is fixed in the latest commit. |
:human
merge tag modifiers on all Date fields #1990GravityView_Field_Date
class because it was overriding the human modifier by running the function again without the new arguments and i couldn't remove the filtergravityview/merge_tags/modifiers/value
as it was happening after the human modifier function.💾 Build file (cb02ebd).