SearchBuilder Requires DateTime when used with dates.

SearchBuilder Requires DateTime when used with dates.

MadBoyEvoMadBoyEvo Posts: 119Questions: 38Answers: 0

Link to test case: https://live.datatables.net/jabaxova/2/edit
Error messages shown: SearchBuilder Requires DateTime when used with dates.
Description of problem:

I used to use very old Search Builder 1.0.1, today I've upgraded to 1.4.2 and same code seems to bug out with error: SearchBuilder Requires DateTime when used with dates. Everything used to work, and now it complains about DateTime. Is there a way I could fix it "globally"? What I mean by that is I don't know what end user will use in the table. Whether it will be DateTime or nor.

In PowerShell, when they use DataTables it's very simple and there's no special treatment for dates at this stage.

$ProcessesAll = Get-Process | Select-Object -First 3 -Property Name, Id, StartTime

New-HTML -TitleText 'Title' -Online -FilePath $PSScriptRoot\Example-SearchBuilder.html -ShowHTML {
    New-HTMLSection -HeaderText 'Search Builder 1' {
        New-HTMLTable -DataTable $ProcessesAll -SearchBuilder -Buttons excelHtml5, copyHtml5, csvHtml5
    }
}

So without me going into code user provided, and verifying whether it has dates or not requires intensive work which will slow down execution.

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794
    edited April 2023 Answer ✓

    Sounds like early versions of SearchBuilder didn't require DateTime. The SearchBuilder docs indicate that it is now a requirement:

    As well as choosing the SearchBuilder package, you also have to add the dependent DateTime package.

    You can use the Download Builder to generate the proper set of libraries for your pages. When you are upgrading the SearchBuilder for a page just include the Datetime library at the same time.

    Kevin

  • MadBoyEvoMadBoyEvo Posts: 119Questions: 38Answers: 0

    Thank you. Since I am using generator in PowerShell I have to be the one that "builds" this, but it's not a problem. Do you know of any other plugins changed their dependencies to require DateTime?

  • colincolin Posts: 15,177Questions: 1Answers: 2,590
    Answer ✓

    Yep, SearchBuilder now requires DateTime to filter date/time fields. I think before it wasn't detecting date/time fields, and just treated them as strings. They now have full calendar support.

    Colin

Sign In or Register to comment.