Git Product home page Git Product logo

Comments (8)

ThaDafinser avatar ThaDafinser commented on June 11, 2024

ping @alessandropietrobelli

For jqGrid currently not: ThaDafinser/ZfcDatagrid#83

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @alessandropietrobelli on April 30, 2014 12:16

Hi @webdevilopers check this line https://github.com/ThaDafinser/ZfcDatagrid/blob/master/config/module.config.php#L76

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @webdevilopers on May 5, 2014 9:35

Thanks @alessandropietrobelli . I just wondered why it doesn't seem to be correctely configured to work with the zfcDatagrid/person/bootstrap example?

Do I have to configure the format param to work with the database format or the display value?

This is the examples column:

        $col = new Column\Select('birthday');
        $col->setLabel('Birthday');
        $col->setWidth(10);
        $col->setType(new Type\DateTime());
        $col->setUserSortDisabled(true);
        $grid->addColumn($col);

        {
            $colType = new Type\DateTime('Y-m-d H:i:s', \IntlDateFormatter::MEDIUM, \IntlDateFormatter::MEDIUM);
            $colType->setSourceTimezone('Europe/Vienna');
            $colType->setOutputTimezone('UTC');

            $col = new Column\Select('changeDate');
            $col->setLabel('Last change');
            $col->setWidth(15);
            $col->setType($colType);
            $grid->addColumn($col);
        }

And this the format param for daterange inside zfcdatagrid.global.php:

                // Daterange bootstrapTable filter configuration example
                'daterange' => array(
                    'enabled' => true,
                    'options' => array(
                        'ranges' => array(
                            'Today' => new \Zend\Json\Expr("[moment().startOf('day'), moment().endOf('day')]"),
                            'Yesterday' => new \Zend\Json\Expr("[moment().subtract('days', 1), moment().subtract('days', 1)]"), 
                            'Last 7 Days' => new \Zend\Json\Expr("[moment().subtract('days', 6), moment()]"),
                            'Last 30 Days'=> new \Zend\Json\Expr("[moment().subtract('days', 29), moment()]"),
                            'This Month' => new \Zend\Json\Expr("[moment().startOf('month'), moment().endOf('month')]"),
                            'Last Month' => new \Zend\Json\Expr("[moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]"),
                        ),
                        'locale' => \Locale::getDefault(),
                        'format' => 'DD/MM/YY HH:mm:ss',
                    ),
                ),

Using 'format' => 'DD.MM.YYYY', for the example and filtering for today would still return items with Birthday set to '31.01.1981'? Same for DD.MM.YYYY HH:mm:ss!

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @webdevilopers on May 27, 2014 13:19

I definetely can't get the daterange picker working!

I shortened the PhpArray for birthday:

        $row = array(
            'id' => 1,
            'displayName' => 'Wayne? John!',
            'familyName' => 'Wayne',
            'givenName' => 'John',
            'email' => '[email protected]',
            'gender' => 'm',
            'age' => 111,
            'weight' => 50,
            'birthday' => '1987-10-03',
            'changeDate' => '2001-04-19 14:30:41'
        );

Then I set the type on the col:

$col = new Column\Select('birthday');
        $col->setLabel('Birthday');
        $col->setWidth(10);

        $colType = new Type\DateTime('Y-m-d', \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE);
        $colType->setSourceTimezone('Europe/Vienna');
        $colType->setOutputTimezone('UTC');

        $col->setType($colType);

        $col->setUserSortDisabled(true);
        $grid->addColumn($col);

I set the daterange picker:

                        'locale' => \Locale::getDefault(),
                        'format' => 'DD.MM.YYYY',

The javascript is correct:

                $('input.daterange').daterangepicker(
        {"ranges":{"Today":[moment().startOf('day'), moment().endOf('day')],"Yesterday":[moment().subtract('days', 1), moment().subtract('days', 1)],"Last 7 Days":[moment().subtract('days', 6), moment()],"Last 30 Days":[moment().subtract('days', 29), moment()],"This Month":[moment().startOf('month'), moment().endOf('month')],"Last Month":[moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]},"locale":"de_DE","format":"DD.MM.YYYY"}        ).on('apply.daterangepicker', function(ev,picker){
            this.form.submit();
        });
    });

The I pick today which generates >= 27.05.2014 - 27.05.2014.

As a result I get two entries with birthday set to 31.01.1981.

Obviously the daterange picker suggests 31.01.1981 to be bigger than 27.05.2014 parsing it as a number. But in a date context it is simply wrong.

Is there still a setting missing / wrong, @ThaDafinser @alessandropietrobelli ?

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @alessandropietrobelli on May 27, 2014 13:28

@webdevilopers Give me a couple of days to test it, I'm a little bit full of work today, I will let you know soon...

Cheers

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @webdevilopers on May 27, 2014 13:33

Sure, @alessandropietrobelli ! Thanks in advance.

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @webdevilopers on June 13, 2014 9:12

Any news, @alessandropietrobelli ?

from zfc-datagrid.

ThaDafinser avatar ThaDafinser commented on June 11, 2024

From @askaushish on February 21, 2017 18:38

Any solution to datepicker in phparray datasource

from zfc-datagrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.