KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to use DateTimeFormat for displaying day? #43

Open zenon opened this topic on on Jul 29, 2017 - 2 comments

zenon commented on Jul 29, 2017

Hi,

How to use DateTimeFormat to display date from 2017-07-17 to 17-07-2017 Mon? Able to change the format of the date from y-m-d to d-m-y, but unable to display the day.

Thanks.

KoolReport commented on Jul 29, 2017

HI zenon,

You do this:

->pipe(new DateTimeFormat(array(
    "date"=>array(
        "from"=>"Y-m-d",
        "to"=>"d-m-Y D"
    ),
)))

Please let me know if you need further assistance.

Regards,

KoolPHP Inc

KoolReport commented on Jul 29, 2017

By the way, if your purpose is just to display on Table you can do:

Table::create(array(
    ...
    "columns"=>array(
        "date"=>array(
            "type"=>"datetime",
            "format"=>"Y-m-d",
            "displayFormat"=>"d-m-Y D"
        ),
        ...
    )
    ...
))

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None