ucsdlib / hifive

An application supporting an Employee Recognition program workflow
MIT License
0 stars 0 forks source link

stats: make end_date inclusive for query #364

Closed mcritchlow closed 4 years ago

mcritchlow commented 4 years ago

Fixes #359

Local Checklist

What does this PR do?

The previous code took the start and end dates from the form, which came in the format of YYYY-MM-DD, and then applies them to the where range query. This works as expected for the start_date, but is problematic for the end_date since a String date of the form YYYY-MM-DD will be turned into a DateTime object which translates to the "beginning of that day".

This is confusing to administrators who expect Recognitions created on the same date as their chosen end_date to be included in the results of the statistics query. This change utilizes the Rails ActiveSupport end_of_day method that gets mixed in to the DateTime.

Why are we doing this? Any context of related work?

References #issuenumber

Where should a reviewer start?

See the new test demonstrating a record created on the same day as the end date in the range query being included in the results.

Deployment Instructions

@ucsdlib/developers - please review