formatoption " " as suffix ?

Questionsformatoption " " as suffix ?
John asked 7 years ago

Hi, I wanted to know if it's possible to get a nbsp or emsp in as suffix since the date is coming to close to another column string.
I tried the following :

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

This worked for a currency with euro but doesn't seem to work with a nbsp.. Or isn't this possible to realize or has to be done as prefix on the adjacent column?

3 Answers
Abu Ghufran answered 7 years ago

You can put a blank space before newformat string. ' d/m/Y'
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>' d/m/Y');

John answered 7 years ago

Doesn't seem to work, no matter how many blank spaces I try to set before or after the newformat.
That's the problem I'm facing when people are printing :

View post on

Abu Ghufran answered 7 years ago

I can't tell exactly what you are doing, but this code results in following image.

$col = array();
$col["title"] = "Date";
$col["name"] = "invdate";
$col["width"] = "150";
$col["editable"] = true; // this column is editable
$col["editoptions"] = array("size"=>20);
$col["formatter"] = "date";
# opts array can have these options:
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>' (*) d.m.Y', "opts" => array("changeYear" => false));


Also, this demo is using full version.

Your Answer

16 + 7 =

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?