Skip to content
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 support for :human merge tag modifiers on all Date fields #1990

Closed
tobifjellner opened this issue Feb 19, 2024 · 3 comments · Fixed by #2131
Closed

Add support for :human merge tag modifiers on all Date fields #1990

tobifjellner opened this issue Feb 19, 2024 · 3 comments · Fixed by #2131
Assignees

Comments

@tobifjellner
Copy link

A customer has suggested that we should add possibility to show timestamps as relative time/relative date

i.e. "Yesterday", "2 hours ago", "Tomorrow", etc.

By UI setting and/or field code parameter.

https://developer.wordpress.org/reference/functions/human_time_diff/ should make this relatively easy.

The tricky part would of course be that only timestamps are truly date and time in one in Gravity Forms.

@floatytheastronaut
Copy link

@zackkatz
Copy link
Member

@rafaehlers Please test to see if :human works with all date fields, not just {date_created} and {date_updated}.

@zackkatz zackkatz changed the title Add possibility to show relative times in GravityView fields Add support for :human merge tag modifiers on all Date fields Aug 19, 2024
@rafaehlers
Copy link
Contributor

It doesn't, unfortunately:

image

@rafaehlers rafaehlers removed their assignment Aug 24, 2024
@omarkasem omarkasem linked a pull request Sep 5, 2024 that will close this issue
mrcasual added a commit that referenced this issue Sep 24, 2024
- FIxes #1990
- I had to edit the `GravityView_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 filter
`gravityview/merge_tags/modifiers/value` as it was happening after the
human modifier function.


💾 [Build
file](https://www.dropbox.com/scl/fi/55s0yfg7q7x5h663r349q/gravityview-2.28.0-cb02ebddc.zip?rlkey=nmffl5isaq265aj4fzxsel67g&dl=1)
(cb02ebd).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants