Date Format on search

QuestionsDate Format on search
Gary Brett asked 5 years ago

Hi Abu, I have a grid with no add/edit/delete but need a filter on the date field. Using code below it outputs Jun-2105 for example, if I search in autofilter for Jun, a datepicker popup appears and the grid is blank. Can I disable the datepicker is that the problem do you think?

I tried removing the 'formatter' with no success?

$col["formatter"] = "date";
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'M-Y');

Thank you

2 Answers
Abu Ghufran answered 5 years ago

You need to set following:

// contains search
$col["searchoptions"]["sopt"] = array("cn");

// contains search date in format Jan-2008
$col["dbname"] = "date_format(invdate,'M-Y')";

Replace invdate with your db field name.

Gary Brett answered 5 years ago

Thanks Abu, I managed to achieve it using the external Date From / Date To search

Cheers

Your Answer

19 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?