Comments (8)
For jqGrid currently not: ThaDafinser/ZfcDatagrid#83
from zfc-datagrid.
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.
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.
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.
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.
From @webdevilopers on May 27, 2014 13:33
Sure, @alessandropietrobelli ! Thanks in advance.
from zfc-datagrid.
From @webdevilopers on June 13, 2014 9:12
Any news, @alessandropietrobelli ?
from zfc-datagrid.
From @askaushish on February 21, 2017 18:38
Any solution to datepicker in phparray datasource
from zfc-datagrid.
Related Issues (20)
- Todo for 2.0 HOT 7
- Custom query HOT 1
- Error rendering NULLs in DateTime columns with PHPExcel HOT 2
- Use route for links or action buttons HOT 3
- Disable cache HOT 7
- Filters - Extended
- Support native ZF Event HOT 2
- Daterange Not working for Doctrine2 Datasource
- Cannot use ZfcDatagrid\Column\DataPopulation\Object as Object because 'Object' HOT 3
- The expediency of using the MvcEvent HOT 6
- Configuration conflict when set non-default cache adapter HOT 3
- Get value from another column HOT 1
- Allow changing column type's `filterDefaultOperation` HOT 1
- Drop support for PHP 5.6 and 7.0 HOT 3
- Implement all filters in ZfcDatagrid\Renderer\JqGrid\View\Helper\Columns::getStyles HOT 3
- Possibility set a column position HOT 1
- Package phpoffice/phpexcel is abandoned HOT 1
- bootstrap v4 template HOT 1
- Add datagrid filters instead of using the columns filters
- TypeError when applying toobar filter on grid with PhpArray datasource and null value in data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zfc-datagrid.