js/letnice.jsView |
---|
| 1 | +const monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; |
| 2 | +const dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] |
| 3 | + |
1 | 4 | function Year(y) |
2 | 5 | { |
3 | 6 | let base = document.getElementById("center"); |
4 | | - |
5 | | - const monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; |
6 | | - const dayNames = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] |
7 | 7 | |
8 | | - let year = y; |
9 | | - window.location.hash = year; |
| 8 | + let year = String(y).replace("#", ""); |
10 | 9 | |
11 | 10 | let month = 0; |
12 | 11 | let today = new Date(year, new Date().getMonth(), new Date().getDate()-1, 0); |
13 | | - let style = "day"; |
| 12 | + let style = ""; |
14 | 13 | |
15 | 14 | while(month < 12) |
16 | 15 | { |
17 | 16 | base.innerHTML += `<div class="month"> |
101 | 100 | location.hash = parseInt(location.hash.replace('#','')) + parseInt(i); |
102 | 101 | } |
103 | 102 | |
104 | 103 | window.onhashchange = function() |
105 | | -{ |
106 | | - if (location.hash.length > 0) |
107 | | - { |
108 | | - Year(parseInt(location.hash.replace('#',''))); |
109 | | - } |
| 104 | +{ |
| 105 | + Year(parseInt(location.hash.replace('#',''))); |
110 | 106 | } |