Skip to content

Commit

Permalink
Fix bug of automcomplete taxa allowing out of bound dates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkohei13 committed Jan 2, 2025
1 parent 74e4a41 commit 21a20ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ Note that in order to create MariaDB database on Rahti, PHPMyAdmin data dump doe

### Next

* Fix autocomplete-added species min/max dates being 2022-??
* Make challenge cards use uniform height
* Challenge sort order (int) for the front page - larger number shown on top
* Refactor trashing. Now issues with
Expand All @@ -113,15 +112,15 @@ Note that in order to create MariaDB database on Rahti, PHPMyAdmin data dump doe

### Setup

- Version numbering?
- More robust error handling and restart? Try with triggering syntax error.
- Database sorting/collation settings utf8mb4_swedish_ci?
- Backup monitoring

### Features todo

- Test:
- If some assertions fails, also trashing the participation wil faill, which make all future tests fail as well.
- Check: If some assertions fail, also trashing the participation will fail, which can leave undeleted participations behind.
- Login fails intermittently with "TypeError: can only concatenate str (not "NoneType") to str"
- For 2025:
- Handling higher taxa (is uses adds rikkavoikukka, don't add voikukat to taxon_count)
- Accessibility
Expand Down
7 changes: 4 additions & 3 deletions app/templates/form_challenge100.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
console.log("Number of filled date fields: " + filledCount);
});

// Autocmplete logic
// Autocomplete logic
const input = document.getElementById('autocomplete-input');
const resultsContainer = document.getElementById('autocomplete-results');

Expand Down Expand Up @@ -203,8 +203,9 @@
const taxaList = document.getElementById('taxa');
const newLi = document.createElement('li');

const min = {{ html['challenge']['date_begin'] }};
let max = {{ html['challenge']['date_end'] }};
const min = "{{ html['challenge']['date_begin'] }}";
let max = "{{ html['challenge']['date_end'] }}";

// If max date is in future, make it today instead
if (max > new Date().toISOString().split('T')[0]) {
max = new Date().toISOString().split('T')[0];
Expand Down

0 comments on commit 21a20ce

Please sign in to comment.