KoolReport's Forum

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

DateRangePicker - manual input #2221

Open Chris Sideris opened this topic on 5 days ago - 2 comments

Chris Sideris commented 5 days ago

Hi there,

I'm using the default DateRangePicker (https://www.koolreport.com/examples/reports/inputs/intro/index.php) that's integrated with KoolReport. I want to allow my users to manually enter a datetime (in addition to the default option of DateRangePicker), but can't seem to find any documentation around it.

Can you help me out with this?

Sebastian Morales commented 4 days ago

Pls open the file koolreport/inputs/DateRangePicker.tpl.php and replace the following lines:

<div id="<?php echo $this->name; ?>" class="date-range-picker form-control">
    <input id="<?php echo $this->name; ?>_start" name="<?php echo $this->name; ?>[]" type="hidden" />
    <input id="<?php echo $this->name; ?>_end" name="<?php echo $this->name; ?>[]" type="hidden" />
    <div style="position:relative;">
        <i class="drp-icon <?php echo $this->icon; ?>"></i>
        <b class="drp-caret <?php echo $this->caret; ?>"></b>   

with this one:

<input id="<?php echo $this->name; ?>" name="<?php echo $this->name; ?>" class="date-range-picker form-control" />

But remember that when changing this the report's daterangepicker parameter would be a string in the format of {startDate} - {endDate} instead of an array of [{startDate}, {endDate}]. You would have to manually convert the range to start date and end date.

We will consider adding this as a template for daterangepicker so that users have more than one choice of UI. Rgds,

Chris Sideris commented 3 days ago

Thank you Sebastian, appreciate your help!

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