Group Date column

QuestionsGroup Date column
Gaëtan asked 3 years ago

I have the following column:

$col = array();
$col["title"] = "Date";
$col["name"] = "date_off_quay";
$col["width"] = "50";
$col["align"] = "center"; // this column is not editable
$col["sortable"] = false; // this column is not sortable
$col["search"] = true; // this column is not searchable
$col["editable"] = true;
$col["hidden"] = true; // HIDE this column
$col["editrules"] = array("edithidden"=>true,"searchhidden"=>true);
$col["formatter"] = "date";
# opts array can have these options:
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'yy-mm-dd', "minDate"=>"08-04-01", "showWeek"=> true));

It works well – date field get saved in the database as long as I don't change the last instruction to:

$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'D d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'yy-mm-dd', "minDate"=>"08-04-01", "showWeek"=> true));

I need to show the DAY (Monday, Tuesday…), this is why I do try to use: ,"newformat"=>'D d.m.y'

When doing so, the date value is saved as EMPTY in the database.

What is the solution please ?


4 Answers
Gaëtan answered 3 years ago

Thanks Abu.
It almost works.
There is still something to do with the "minDate" … I tried "minDate"=>"Su 01.05.16" …
But the min date does not work… I can only enter from 13/07/2016 for some (format ?) reasons.


Abu Ghufran answered 3 years ago

To set minDate, try "minDate"=>"Tue 2.2.16",

$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'D d.m.y', "opts" => array("changeYear" => true, "dateFormat"=>'D', "minDate"=>"Tue 2.2.16", "showWeek"=> true));

Make sure you write correct weekday name.

Gaëtan answered 3 years ago

Thanks Abu, it works.

Your Answer

8 + 5 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!