git ssb

0+

Rômulo Alves / dat-letnice



Commit 2b6dbab4cf1db85518e47f39c06ea9560e89c2ab

wip

nomand committed on 6/6/2018, 3:40:12 AM
Parent: 4cb7497b9a595aeaa9018b4ebff615193e4fc77f

Files changed

index.htmlchanged
js/letnice.jschanged
index.htmlView
@@ -10,8 +10,8 @@
1010 <body>
1111 <section id="center">
1212 </section>
1313 <script>
14- let letnice = new Year(new Date().getFullYear());
14+ let letnice = new Year(window.location.hash);
1515 </script>
1616 </body>
1717 </html>
js/letnice.jsView
@@ -1,17 +1,16 @@
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+
14 function Year(y)
25 {
36 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" ]
77
8- let year = y;//new Date().getFullYear();
9- window.location.hash = year;
8+ let year = String(y).replace("#", "");
109
1110 let month = 0;
1211 let today = new Date(year, new Date().getMonth(), new Date().getDate()-1, 0);
13- let style = "day";
12+ let style = "";
1413
1514 while(month < 12)
1615 {
1716 base.innerHTML += `<div class="month">
@@ -101,10 +100,7 @@
101100 location.hash = parseInt(location.hash.replace('#','')) + parseInt(i);
102101 }
103102
104103 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('#','')));
110106 }

Built with git-ssb-web