Skip to content

Commit

Permalink
Fix end date on url creation
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolai Rozanov <nickolay.rozanov@gmail.com>
  • Loading branch information
nrozanov committed Apr 9, 2024
1 parent 8e52a0c commit b684acf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flexmeasures/ui/templates/crud/asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ <h3>Edit {{ asset.name }}</h3>
const dummy = document.createElement('p');

var startDate = encodeURIComponent(toIsoString(picker.getStartDate().toJSDate()));
var endDate = encodeURIComponent(toIsoString(picker.getEndDate().toJSDate()));
// add 1 day to end date as datepicker does not include the end date day
var endDate = picker.getEndDate();
endDate.setDate(endDate.getDate() + 1);
endDate = encodeURIComponent(toIsoString(endDate.toJSDate()));
var base_url = window.location.href.split("?")[0];
dummy.textContent = `${base_url}?start_time=${startDate}&end_time=${endDate}`
document.body.appendChild(dummy);
Expand Down

0 comments on commit b684acf

Please sign in to comment.