TDF does a great job of tracking file downloads and the Views integration is working nicely. I have created a View and a Views Data Export to periodically export reports of files downloads, but cannot filter the results by dates since the Time field is displayed as a Unix timestamp. The reports that are included with TDF display readable dates instead of the timestamp. Is it possible to format the timestamp as a readable date or otherwise be able to use the Time field to filter the views results by date?

Comments

edodes’s picture

Hi,

I solved this problem. That field in view is defined as numeric instead of date.

Edit the file track_da_files.views.in situated in track_da_files/includes/views folder.

Change views_handler_field_numeric with views_handler_field_date value :

// time.
$table['track_da_files']['time'] = array(
'title' => t('Time'),
'help' => t('Time'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'help' => t('Time'),
'click sortable' => true,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'allow empty' => true,
'help' => t('Filter on Time'),
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'help' => t('Time'),
),

with

// time.
$table['track_da_files']['time'] = array(
'title' => t('Time'),
'help' => t('Time'),
'field' => array(
'handler' => 'views_handler_field_date',
'help' => t('Time'),
'click sortable' => true,
),
'filter' => array(
'handler' => 'views_handler_filter_date',
'allow empty' => true,
'help' => t('Filter on Time'),
),
'argument' => array(
'handler' => 'views_handler_argument_date',
'help' => t('Time'),
),

edodes’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

oksana-c’s picture

Category: Support request » Feature request
Status: Closed (fixed) » Needs review
StatusFileSize
new889 bytes

Created a patch with edodes code.
Marking this as "Needs Review" because the patch is not yet committed in dev.

Status: Needs review » Needs work
oksana-c’s picture

adjusted patch format

oksana-c’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
oksana-c’s picture

Status: Needs work » Needs review
StatusFileSize
new912 bytes

ok, learning on my own mistakes. This time should pass the test...

Status: Needs review » Needs work
oksana-c’s picture

Status: Needs work » Needs review
StatusFileSize
new912 bytes

  • federiko_ committed 870a453 on 7.x-1.x authored by oksana-c
    Issue #2442421 by oksana-c, edodes, DSquaredB: Date formatter for Time...
federiko_’s picture

Status: Needs review » Fixed

Thank you all for your contribution.
oksana-c , your last patch has been commited in stable release of the module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.