Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wochenansicht: Direktes Aufrufen einer bestimmten Kalenderwoche #101

Open
PowerOfCreation opened this issue Jun 8, 2022 · 0 comments
Open

Comments

@PowerOfCreation
Copy link
Owner

Ziel: Wird localhost?calendarWeek=10 aufgerufen wird die 10. Kalenderwoche des aktuellen Jahrs geladen und bei localhost?calendarWeek=10&year=2023 entsprechend die 10 KW des Jahres 2023.

Implementiert werden kann dies mit: https://www.sitepoint.com/get-url-parameters-with-javascript/ und dann entsprechend die globalCalendarWeek Variable setzen und ggf eine globalYear Variable einfügen.

Alternativ(wesentlich aufwendiger und kein wirklicher Mehrwert):

JavaScript Code via PHP senden Beispiel:

Diese Zeile in weekly-report.js wird gelöscht:
var globalCalendarWeek = getCalendarWeek();
Dafür bekommt webserver/index.php folgende Logik nachdem JQuery geladen ist, aber bevor weekly-report.js geladen wird:
$calendarWeek= htmlspecialchars($post[calendarweek....
echo "<script>$() {var globalCalendarWeek = " . $calendarWeek . ";}</script>"

Siehe auch https://stackoverflow.com/a/23740549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant