codefordenver / Comrad

Open-source web application for radio stations to manage show schedules, traffic and compliance
ISC License
25 stars 9 forks source link

Change default dates for Sound Exchange and Underwriting reports #863

Closed seankwilliams closed 1 year ago

seankwilliams commented 1 year ago

Let's change the pages at:

/reporting/sound-exchange /reporting/underwriting

So that the default date range has a from date of 30 days ago, and a to date of today.

kmid5280 commented 1 year ago

@seankwilliams It looks like this page utilizes the FormDateRangeForExport form, which uses the DatePicker plugin. This form is used on a few other pages as well. Would you want to set a default range of 30 days on this form itself so the range would exist in any case, or only display the range on the above two pages? If the latter, we might need to pass in a prop that will tell it whether or not to use the 30 day range.

Do you know if there is a method to set the default date range on DatePicker? I'm wondering if we need to follow the logic outlined in the docs discussing the Calendar Start day.

seankwilliams commented 1 year ago

@kmid5280 Only those two pages, so I think your suggestion of passing in a prop to tell the component whether to use the 30 day range makes sense.

You'll probably want to look at setting the initial values for the field as opposed to changing anything in the date picker itself. The date pickers should function as they do now - they'll just have a starting value instead of being blank when the page loads.

kmid5280 commented 1 year ago

@seankwilliams I'm able to define a starting date value of 30 days prior to today's date for the From input field. If I add the selected property to the component and set the value to the starting date however, it automatically populates that date in the input field once the page loads. Do you want this behavior, or do you want the input field to remain blank once the page opens while the popper defaults to that date once the field is selected?

seankwilliams commented 1 year ago

@kmid5280 The input fields should have values immediately on page load, without the user needing to click into them.