mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 03:30:50 +02:00
move the start and end date assignemnets inside check for elements
This commit is contained in:
parent
fb03b6e2bc
commit
9dffa049b8
1 changed files with 5 additions and 4 deletions
|
@ -283,19 +283,20 @@ function enableRelatedWidgetButtons(changeLink, deleteLink, viewLink, elementPk,
|
||||||
(function (){
|
(function (){
|
||||||
|
|
||||||
// Get the current date in the format YYYY-MM-DD
|
// 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
|
// Default the value of the start date input field to the current date
|
||||||
let startDateInput =document.getElementById('start');
|
let startDateInput =document.getElementById('start');
|
||||||
startDateInput.value = currentDate;
|
|
||||||
|
|
||||||
// Default the value of the end date input field to the current date
|
// Default the value of the end date input field to the current date
|
||||||
let endDateInput =document.getElementById('end');
|
let endDateInput =document.getElementById('end');
|
||||||
endDateInput.value = currentDate;
|
|
||||||
|
|
||||||
let exportGrowthReportButton = document.getElementById('exportLink');
|
let exportGrowthReportButton = document.getElementById('exportLink');
|
||||||
|
|
||||||
if (exportGrowthReportButton) {
|
if (exportGrowthReportButton) {
|
||||||
|
startDateInput.value = currentDate;
|
||||||
|
endDateInput.value = currentDate;
|
||||||
|
|
||||||
exportGrowthReportButton.addEventListener('click', function() {
|
exportGrowthReportButton.addEventListener('click', function() {
|
||||||
// Get the selected start and end dates
|
// Get the selected start and end dates
|
||||||
let startDate = startDateInput.value;
|
let startDate = startDateInput.value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue