Group Date column

QuestionsGroup Date column
Gaëtan asked 9 years ago

Hi,
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: http://api.jqueryui.com/datepicker/
$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 ?

Thanks

4 Answers
Gaëtan answered 9 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.

Gaëtan

Abu Ghufran answered 9 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 dd.mm.y', "minDate"=>"Tue 2.2.16", "showWeek"=> true));

Make sure you write correct weekday name.

Gaëtan answered 9 years ago

Thanks Abu, it works.

Your Answer

14 + 18 =

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?