1
0
forked from ScoDoc/ScoDoc

EDT: fix pb affichage signalés par PB

This commit is contained in:
Emmanuel Viennet 2024-01-09 02:03:16 +01:00
parent a63ed6c0ef
commit 1e33626b60
2 changed files with 8 additions and 5 deletions

View File

@ -179,7 +179,6 @@ document.addEventListener('DOMContentLoaded', function() {
var renderRange = document.getElementById('renderRange');
var options = calendar.getOptions();
var viewName = calendar.getViewName();
var html = [];
if (viewName === 'day') {
html.push(calendar.getDate().toDate().toLocaleString('fr-Fr', {
@ -221,13 +220,15 @@ document.addEventListener('DOMContentLoaded', function() {
changeCalendarDate();
}
// Update current URL when date change (newDate=ISO string)
function updateCurrentDateInUrl(newDate) {
function updateParametersInUrl(newParams) {
// Parse the current URL
const currentUrl = new URL(window.location.href);
// Access and modify the search parameters
const searchParams = currentUrl.searchParams;
searchParams.set('current_date', newDate); // Set the new date
Object.entries(newParams).forEach(([key, value]) => {
searchParams.set(key, value);
});
// Create the new URL
const newUrl = `${currentUrl.origin}${currentUrl.pathname}?${searchParams.toString()}`;
@ -240,7 +241,7 @@ document.addEventListener('DOMContentLoaded', function() {
setRenderRangeText();
// current calendar date, ISO, without time
const iso_date = calendar.getDateRangeStart().toDate().toISOString().split('T')[0];
updateCurrentDateInUrl(iso_date);
updateParametersInUrl( { current_date: iso_date } );
calendar_control_form.current_date.value = iso_date;
}
// View menu
@ -260,6 +261,8 @@ document.addEventListener('DOMContentLoaded', function() {
const selectedText = this.textContent;
const selectedView = this.getAttribute('data-view');
calendar.changeView(selectedView); // Change the calendar view
updateParametersInUrl( { view : selectedView } );
setRenderRangeText();
dropbtn.textContent = selectedText; // Update the button text
dropdownContent.style.display = 'none';
});

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.6.75"
SCOVERSION = "9.6.76"
SCONAME = "ScoDoc"