Skip to content

Commit

Permalink
Merge pull request #1721 from cisagov/hotfix-js-check
Browse files Browse the repository at this point in the history
Move the start and end date assignments inside check for elements
  • Loading branch information
rachidatecs authored Jan 31, 2024
2 parents fb03b6e + 9dffa04 commit 2368aaa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/registrar/assets/js/get-gov-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,20 @@ function enableRelatedWidgetButtons(changeLink, deleteLink, viewLink, elementPk,
(function (){

// Get the current date in the format YYYY-MM-DD
var currentDate = new Date().toISOString().split('T')[0];
let currentDate = new Date().toISOString().split('T')[0];

// Default the value of the start date input field to the current date
let startDateInput =document.getElementById('start');
startDateInput.value = currentDate;


// Default the value of the end date input field to the current date
let endDateInput =document.getElementById('end');
endDateInput.value = currentDate;

let exportGrowthReportButton = document.getElementById('exportLink');

if (exportGrowthReportButton) {
startDateInput.value = currentDate;
endDateInput.value = currentDate;

exportGrowthReportButton.addEventListener('click', function() {
// Get the selected start and end dates
let startDate = startDateInput.value;
Expand Down

0 comments on commit 2368aaa

Please sign in to comment.