Okay
  Public Ticket #1735671
Date Filtering
Closed

Comments

  • Timothy Lascak started the conversation

    How do you set the date to sort by current date by default.

    I know i can set filtering rule, and set a predefined date but i want that predefined date to be "Today's Date" or " Current Date".

    It only allows me to pick a predefined date, and no option for Today's date. Is there a shortcode or something i can put there to set it to current date.


    Thanks

  •  471
    Isidora replied

    Hi Timothy,
    Thank you for your purchase.

    Unfortunately at the moment is not possible to set current day in filter predefined value.

    You can achieve this with SQL query like this

    SELECT *
    FROM table_name
    WHERE table_name.`name_of_column_that_contain_date` = CURDATE()
    

    Like this will be shown only rows with current day.

    If you not using queries, you can also filter the table with Conditional formatting for that column where is available %TODAY% placeholder. You have to set rules like this(attachment 1) where you will set two rules one that is less than %TODAY%  and second that is greater than %TODAY% and set row class for example hide(like in example)

    Then you have to make that class in  Custom wpDataTables CSS under the "Custom JS AND CSS" in main settings of wpdatatables.(attachment 2)

    table.wpDataTable tr.hide {
    display:none !important;
    }
    

    Like this will be shown data only for current date.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables