Okay
  Public Ticket #2743967
Showing Last X Day
Closed

Comments

  • Saro started the conversation

    Hi 

    I am trying to show data from Gravityforms for today only. 

    I set the field to "0" days and it works fine, until 5pm.

    I am in PST time zone, (+8) and the entries on my database are stored as UTC

    so my 5pm is actually 12am in UTC (a new day)

    How can I make these match?

    Ps; On my site the entry date on the wpdatacharts shows the correct time and date (PST).

    The mix up only happens when your system pulls data after 5pm. 

  • [deleted] replied

    Hi Saro

    Thank you for reaching out to us.

    All database entries are usually in UTC+0

    wpDataTables has issues with Formidable Forms based tables and Gravity Forms based tables, for instance. They save the entry time in UTC+0, and wpDataTables sees it just like that since it's pulling raw data from the database. It doesn't have any adapters which would recognize the current date and time.

    If someone need such function can grab some code:

    function timestamp_for_wpdatatables ( $formdata, $tableId ) {   

        $columnsData = WDTConfigController::loadColumnsFromDB($tableId);      foreach ($columnsData as $column) {          if ($column->orig_header == "timestamp") {                  $formdata["timestamp"] = date("Y-m-d H:i:s");          }elseif ($column->orig_header == "created" && get_query_var('new_created_for_wpdatatables') == true) {                 $formdata["created"] = date("Y-m-d H:i:s");          }

         }         return $formdata; } add_filter('wpdatatables_filter_formdata_before_save', 'timestamp_for_wpdatatables',10,2);

    function created_for_wpdatatables ( $formdata, $tableId ) {

        if ($formdata['wdt_ID'] == '') {         set_query_var('new_created_for_wpdatatables', true);     }     return $formdata; } add_filter('wpdatatables_filter_frontend_formdata', 'created_for_wpdatatables',10,2);

    This can auto-increment datetime into columns with headers "timestamp" or "created"

    Please note that this is a custom solution, so you will need some coding knowledge to implement this. Included support for the plugin doesn't cover writing custom code.


  • Saro replied

    Thanks for this. 

    So.. 

    Do I just copy and paste this code in the "Custom wpDataTables JS" area? 

  •  2,572
    Aleksandar replied

    Hello Saro

    I'm sorry for the misinformation provided here, but what Blazenka shared with you is for manual, editable tables which have a DateTime column that gets updated every time a user edits the data. It is used for entering the exact time and date of when the new data is being entered. It has nothing to do with Gravity Forms-based tables.

    I believe the issue is with the database, similar to the other ticket you have open with me. I talked to one of our developers, and he asked if it's possible for you to clone your website?

    If yes - I'll ask you to install the Duplicator plugin. It will generate a couple of files that you can send me (along with the log-in credentials), and then I can create an exact copy of your website, see what the issue is and try to resolve it.

    The Duplicator plugin can export only up to 500MB of data, so if your site is bigger than that, please use the All-in-One WP Migration plugin.

    Please note that the files will be too large to attach to the ticket, so you can upload them via wetransfer.com and just send me the link.

    Also, please note that this is a public ticket, so make sure to enable the PRIVATE response, so your duplicator files are only visible to us.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Saro replied

    Hi Aleksander, 


    I am sure it is a simple fix. I don't think I will need to duplicate the site. Especially because we have proprietary code in it. 

  •  2,572
    Aleksandar replied

    Hello again Saro

    Our developers believe that this is happening because you set the "date" type column for DateTime values. However, we can't fully replicate the issue locally without a more detailed explanation of what you created, on wich URLs are charts and tables, where you set the 0 (is it in Gravity), etc?

    The quickest way to get to the bottom of this would be with a duplicated site, but if you're not willing to provide us with that, please provide us with a detailed explanation how we can replicate it locally, and we'll see what we can do.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Saro replied

    We use the "Entry date" hidden field from gravity forms. 

    We import and use it on WPdatatables 


    4296467158.png

    And the "Data" type is DateTime

    3015461063.png


  •  2,572
    Aleksandar replied

    Thank you for the info, Saro, I forwarded it to our developers, and they said they would still need the duplicated site so they can troubleshoot and debug this locally.

    If you have some confidential information, could you create a staging site without the sensitive data, replicate the issue, and then duplicate that site and send it to us in a Private response?

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Saro replied

    Hi Aleksander 


    i think I found the solution to my problem. 

    I had the "Gravity Settings" set to Date Range to show "0" Days

    I changed it to 1 day, and now after 5pm it still shows today's entries. 


    Thank you 


  • Saro replied

    Hi Aleksander, 

    That still didn't work as I want to. 

    But I just found the true issue.

    It's not really an issue. 

    In WPDatatables, 

    When I select the column entry date,  and click on Data; I select DateTime 

    Then in "Filtering" I have selected "DateRange"

    This needs to be "DateTime" because it uses the current time when you select it. 

    I want a form to show Today's logs only when it is loaded. 

    I also want to be able to filter based on a previous days logs. 

    How do I do this? 

  •  2,572
    Aleksandar replied

    Hi again Saro.

    If you're using a DateTime column, you need to use the DateTime filter.

    Sunce you set predefined filtering in Gravity settings, filtering of the last day ("Filter by last X time period" set to "1 day"), it will always be displayed like that because this filter will always be within this logic and it can't display what you need after the load.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Saro replied

    Hi Aleksander, 


    Thank you for that. 

    Is there some URL filters I can you to display today only entries, instead of gravity settings?

    Do you have a list of shortcuts for URL filters? 

  •  2,572
    Aleksandar replied

    You're welcome, Saro

    The URL filters are basically values that are applied to the actual filters of wpDataTables, and the only valid date and dateTime filters in wpDataTables are range-type filters, so there's no way to apply only today's entries through them.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables