diff options
-rw-r--r-- | static/index.html | 4 | ||||
-rw-r--r-- | static/script.js | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/static/index.html b/static/index.html index 891f219..4026e43 100644 --- a/static/index.html +++ b/static/index.html @@ -118,6 +118,6 @@ } </style> -<script src="/static/script.js"></script> +<script src="/rbs/static/script.js"></script> </body> -</html>
\ No newline at end of file +</html> diff --git a/static/script.js b/static/script.js index cfab383..77f55b0 100644 --- a/static/script.js +++ b/static/script.js @@ -1,10 +1,12 @@ -const xmlHttp = new XMLHttpRequest(); +/*const xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState === 4 && xmlHttp.status === 200) renderTable(JSON.parse(xmlHttp.responseText)); }; xmlHttp.open("GET", "http://127.0.0.1:5000/api", true); -xmlHttp.send(); +xmlHttp.send();*/ + +renderTable([]); function renderTable(data) { const configs = getConfigs(); @@ -73,12 +75,11 @@ function getConfigs() { } } -Date.prototype.getWeek = function () { - const firstJan = new Date(this.getFullYear(), 0, 1); - return Math.ceil((((this - firstJan) / 86400000) + firstJan.getDay() + 1) / 7); -}; - function getWeekType() { + Date.prototype.getWeek = function () { + const firstJan = new Date(this.getFullYear(), 0, 1); + return Math.ceil((((this - firstJan) / 86400000) + firstJan.getDay() + 1) / 7); + }; const table = { 37: "a", 38: "b", @@ -126,7 +127,7 @@ function getWeekType() { try { return table[date.getWeek()] } catch (e) { - alert("Ferien!"); + alert("Ferien!"); return "a" } } |