backdrop-contrib / views_aggregator

Aggregates views results after performing database query
GNU General Public License v2.0
0 stars 4 forks source link

Date fields are not formatted after aggregation #20

Closed AlexHoebart-ICPDR closed 8 months ago

AlexHoebart-ICPDR commented 8 months ago

When trying to use the "Maximum", "Minimum" function on any date field, e.g. the Post or Update date of nodes, it always renders as a timestamp, regardless of what date format is selected in the field configuration.

The reason seems to be that Views Aggregator Plus is treating the timestamp as a number and rendering it with the format_number() function.

This is a bug inherited from the Drupal 7 module, see the following issue: https://www.drupal.org/project/views_aggregator/issues/2728033

The patch provided there in #7 by morbiD seems to solve the problem. It can be also applied "as is" to the Backdrop module. I haven't reviewed the code yet, but I suggest to review and potentially integrate it into the Backdrop version of this module.

If needed, I can create a PR for this here.

argiepiano commented 8 months ago

Thanks, @AlexHoebart-ICPDR. Can you please provide a PR so that I can test and review?

AlexHoebart-ICPDR commented 8 months ago

The PR is ready for review.

argiepiano commented 8 months ago

Thanks. I'll get to this soon

argiepiano commented 8 months ago

@AlexHoebart-ICPDR thanks so much for submitting a PR. Looks good! I have reviewed your code and added some suggestions. Please make those changes and push the PR again.

argiepiano commented 8 months ago

@AlexHoebart-ICPDR, thanks for the changes. I've merged the PR (and a couple others), but haven't yet done a new release. Would you mind testing the current dev version in your site to be sure everything is working as expected? Thanks!

AlexHoebart-ICPDR commented 8 months ago

Thanks @argiepiano for reviewing and merging the PR. I did a short test with the current dev version (I only use it for one View), all looks good. Looking forward to the new release - thanks for maintaining this useful module!

argiepiano commented 8 months ago

Release is out!