GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
246 stars 62 forks source link

Issue/1978 add merge tags now today yesterday #2143

Closed omarkasem closed 1 month ago

omarkasem commented 2 months ago

💾 Build file (97f835136).

mrcasual commented 2 months ago

@Mwalek, please test and ensure that it works properly with different timezones.

Mwalek commented 2 months ago

@omarkasem @mrcasual

Screenshot 2024-09-17 at 4 45 38 PM Screenshot 2024-09-17 at 5 12 04 PM Screenshot 2024-09-17 at 4 58 53 PM Screenshot 2024-09-17 at 5 04 52 PM

Summary of Issues:

Test URL: https://gv-issue-2143.try.gravitykit.com/display-m-tag-view/ (test:test)

rafaehlers commented 2 months ago

Should now output yyyy-mm-dd hh:mm:ss?

Also, the default output of today and yesterday should be a formatted date that can be used inside the Advanced Filters and/or [gvlogic] shortcode. @Mwalek did you test them on AF and [gvlogic]? If not, please do!

We need to be able to work on these conditions: https://docs.gravitykit.com/article/446-highlighting-entries-about-to-expire

omarkasem commented 2 months ago

@Mwalek @rafaehlers 1- The new tags act the same way as the today tag, so if you want to get the full value then you have to do {now:raw} That the same thing that happens with today and date_updated etc.. 2- I don't think we have to add them to the dropdown like gf does with today 3- I don't understand this one, What do you mean by unix timestamp? It works when i change the timezone in wordpress settings, how can i test that unix timestamp so i can test it?

I also tested it with gvlogic with now:timestamp and it worked

Mwalek commented 2 months ago

@omarkasem

  1. Thanks for clarifying. {now:raw} works. Example output: 2024-09-19 00:46:11
  2. Noted.
  3. Please make reference to the following video: https://www.loom.com/share/328d3a93bb25402fbecad93769441832?sid=42d4aa6f-028c-44c9-bca6-c02bb8bb3554

@rafaehlers I'm still testing AF, but I can confirm that the new merge tags work with [gvlogic]. E.g:

[gvlogic if="{Due Date:3:mdy}" less_than="{today:format:m/d/Y}"]
    <span class="gk-task gk-task-expired">Expired</span>
[/gvlogic]

[gvlogic if="{Due Date:3:mdy}" is="{today:format:m/d/Y}"]
    <span class="gk-task gk-task-expiring-soon">Expiring Soon</span>
[/gvlogic]

[gvlogic if="{Due Date:3:mdy}" greater_than="{today:format:m/d/Y}"]
    <span class="gk-task gk-task-on-time">On Time</span>
[/gvlogic]
omarkasem commented 2 months ago

@Mwalek Thanks for the detailed video, That's fixed now with the latest commit

Mwalek commented 2 months ago

Thanks @omarkasem!

@rafaehlers Do you want to propose any changes before I proceed to test the latest commit?

mrcasual commented 2 months ago

@rafaehlers, please see @Mwalek's comment.

rafaehlers commented 2 months ago

No, that's it, we're good @Mwalek 👍

Mwalek commented 2 months ago

~@omarkasem using 97f8351, the Advanced Filters "Add Condition" button doesn't show up, could you check?~

~### Steps to Reproduce~ ~1. Install and activate 97f8351~ ~2. Install and activate Advanced Filters~ ~3. Create a NEW View~ ~4. Visit the Filter & Sort Tab~

~Expected: The Add Condition button should be visible.~

~Actual: The Add Condition button is not visible.~

~Loom Video: https://www.loom.com/share/9d0bcd646a7c48958924e29e2c63ec81?sid=6f03f44a-3e20-403c-b4c9-49642625b356~

mrcasual commented 1 month ago

@Mwalek, was this fully tested?

@omarkasem, I see some outstanding items in this comment.

Mwalek commented 1 month ago

@mrcasual needed to test a bit more. It's fully tested now. Couldn't spot any issues on PHP 7.4 and 8.3, even while using AF.