Skip to content

Commit

Permalink
Updated whitelist, formatted api.js a bit, added the start/end url sh…
Browse files Browse the repository at this point in the history
…aring
  • Loading branch information
amonsour committed Oct 13, 2023
1 parent aa74656 commit dbcaf57
Show file tree
Hide file tree
Showing 3 changed files with 955 additions and 1,372 deletions.
24 changes: 0 additions & 24 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ <h1 id="wb-cont" property="name" data-i18n="app-title"></h1>
</label>
<input class="form-control" type="date" id="startdate" name="startdate" min="" required="required"/>
</div>
<script>startdate.max = new Date().toISOString().split("T")[0];</script>

<!-- calendar date picker for enddate -->
<div class="form-group">
Expand All @@ -153,29 +152,6 @@ <h1 id="wb-cont" property="name" data-i18n="app-title"></h1>
</label>
<input class="form-control" type="date" id="enddate" name="enddate" min="" required="required"/>
</div>
<script>enddate.max = new Date().toISOString().split("T")[0];</script>
<script>
// Get the current date
var threeYearsAgo = new Date();
// Subtract 3 years from the current date
threeYearsAgo.setFullYear(threeYearsAgo.getFullYear() - 3);
// Format the date as YYYY-MM-DD
var formattedThreeYearsAgo = threeYearsAgo.toISOString().slice(0, 10);
// Set the minimum value of the calendar input fields to the formatted date so that users cannot select a date that is more than 3 years ago, since AA data is only available for the past 3 years
document.getElementById('startdate').setAttribute('min', formattedThreeYearsAgo);
document.getElementById('enddate').setAttribute('min', formattedThreeYearsAgo);

// Get the start date and end date input elements
var startdateInput = document.getElementById("startdate");
var enddateInput = document.getElementById("enddate");
// prevent the user from setting an invalid date range, such as an enddate that is before the startdate
startdateInput.addEventListener("input", function() {
enddateInput.min = startdateInput.value;
});
enddateInput.addEventListener("input", function() {
startdateInput.max = enddateInput.value;
});
</script>
</div>
<button data-gc-analytics-formsubmit="submit" class="btn btn-primary" id="searchBttn" type="submit"><span class="glyphicon-search glyphicon"></span> <span data-i18n="Getdata"></span></button>

Expand Down
Loading

0 comments on commit dbcaf57

Please sign in to comment.