KoolReport's Forum

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

DateTimePicker default value #1096

Open Ralf Föhring opened this topic on on Sep 23, 2019 - 3 comments

Ralf Föhring commented on Sep 23, 2019

Hi, I need an advice on how to set the default value for the dateTimePicker input to empty. Regardless of what I've tried the picker shows the current date every time on load.

 DateTimePicker::create(array(
                    "name"=>"startDatePicker",
                    "maxDate"=>"@endDatePicker",
                    "format"=>"DD.MM.YYYY",
                    "themeBase"=>"bs4",
                    'options' => [
                        'useCurrent' => false,
                        'defaultDate' => false
                    ],
                    'value' => ''
                ));
KoolReport commented on Sep 24, 2019

You go to line 72 "inputs/DateTimePicker.php", you will see:

        if($this->value===null)
        {
            $this->value=date('Y-m-d H:i:s');
        }

Comment out the $this->value=date('Y-m-d H:i:s'); will help.

Ralf Föhring commented on Sep 24, 2019

Thank you!

Ralf Föhring commented on Oct 8, 2019

Looks like this triggers a js error.

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
bug
help needed

Inputs