I have a custom table with a field "ShowDate" of type date. I have a custom module that maps this table as shown below. I am able to create a view and list all of the existing data but I need to filter by date like "now -1 day". This filter is setup as ">= now -1 day" but all of the data shows. An example of thjs field in the table is "2023-03-18" and this shows in the view.
function signup_views_data() {
$data = array();
$data['ShowsNotices']['table']['group'] = t('ShowsNotices');
$data['ShowsNotices']['table']['base'] = array(
'field' => 'ShowNoticeID', // This is the identifier field for the view.
'title' => t('Shows and Notices'),
'help' => t('Shows and Notices'),
'weight' => -10,
);
$data['ShowsNotices']['ShowNoticeID'] = array(
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE, // This is use by the table display plugin.
),
'title' => t('ID'),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['ShowsNotices']['Place'] = array(
'title' => t('Place'),
'help' => t('Just a plain text field.'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE, // This is use by the table display plugin.
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['ShowsNotices']['ShowDate'] = array(
'title' => t('Show Date'),
'help' => t('Date of Show.'),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
return $data;
}
Recent comments
@xorgev Thanks for linking to this video. It is a good one that I had not seen before. There are lots of resources on the Internet for Backdrop CMS and it is challenging to figure out how they...
Suggestion to improve the visibility of helpful content for new users
This is helpful. When I Googled for suggestions about the error message, I found an old entry in Stack Overflow that suggested increasing max_connections. I passed that along to the hosting...
"SQLSTATE[08004] [1040] Too many connections" error - any ideas?
Thanks for the suggestions. All caches have been enabled from the start. I'm not sure what qualifies as a "complex" view. There are 400-500 pages that include EVA fields. But the vast...
"SQLSTATE[08004] [1040] Too many connections" error - any ideas?
Also, when we had some problems with the Backdrop sites, this is what the server admin did: I have increased the max_connections for mariadb and increased the child_processes for...
"SQLSTATE[08004] [1040] Too many connections" error - any ideas?
Have you enabled caches on the site at: Admin Bar > Configuration > Development > Performance (admin/config/development/performance) Are there any complex Views that...
"SQLSTATE[08004] [1040] Too many connections" error - any ideas?