Skip to content

Commit

Permalink
Update daily_summary.html
Browse files Browse the repository at this point in the history
  • Loading branch information
bertybuttface committed Apr 10, 2024
1 parent ad8218f commit 4989ea3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/daily_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block date_picker %}
<form class="d-flex">
<input type="date" id="date-picker" class="form-control" value="{{ date }}" min="{{ earliest_date }}" max="{{ today }}" onchange="navigateToDailySummary(this)" />
<input type="date" id="date-picker" class="form-control" value="{{ date }}" min="{{ earliest_date }}" max="{{ date }}" data-daily-summary-url="{{ url_for('show_daily_summary_dummy') }}" onchange="navigateToDailySummary(this)" />
</form>
{% endblock %}

Expand Down Expand Up @@ -54,7 +54,8 @@ <h2>Daily Summary for {{ date }}</h2>
<script>
function navigateToDailySummary(input) {
const selectedDate = input.value;
window.location.href = `/daily_summary/${selectedDate}`;
const baseUrl = input.getAttribute('data-daily-summary-url');
window.location.href = baseUrl + selectedDate;
}
</script>
{% endblock %}

0 comments on commit 4989ea3

Please sign in to comment.