{"id":175,"date":"2013-07-31T17:49:00","date_gmt":"2013-07-31T13:49:00","guid":{"rendered":"http:\/\/infobs.athn.ru\/?p=175"},"modified":"2013-07-31T17:49:00","modified_gmt":"2013-07-31T13:49:00","slug":"kalendarik","status":"publish","type":"post","link":"https:\/\/infobase.athn.ru\/program\/2013\/07\/kalendarik\/","title":{"rendered":"\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0438\u043a"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/infobase.athn.ru\/program\/wp-content\/uploads\/sites\/7\/2013\/07\/78701.png\" alt=\"\" title=\"78701\" width=\"512\" height=\"512\" class=\"aligncenter size-full wp-image-177\" srcset=\"https:\/\/infobase.athn.ru\/program\/wp-content\/uploads\/sites\/7\/2013\/07\/78701.png 512w, https:\/\/infobase.athn.ru\/program\/wp-content\/uploads\/sites\/7\/2013\/07\/78701-150x150.png 150w, https:\/\/infobase.athn.ru\/program\/wp-content\/uploads\/sites\/7\/2013\/07\/78701-300x300.png 300w, https:\/\/infobase.athn.ru\/program\/wp-content\/uploads\/sites\/7\/2013\/07\/78701-100x100.png 100w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/p>\n<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 2013 \u0433\u043e\u0434 \u0438 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0433\u043e\u0434.<\/p>\n<p><!--more--><\/p>\n<pre>\nfunction January_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',     1,     2,     3,     4,    '5' ],\n\t\t[    '6',     7,     8,     9,    10,    11,   '12' ],\n\t\t[   '13',    14,    15,    16,    17,    18,   '19' ],\n\t\t[   '20',    21,    22,    23,    24,    25,   '26' ],\n\t\t[   '27',    28,    29,    30,    31,    '',    ''  ]\n\t];\n}\n,\nfunction February_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',    '',    '',     1,    '2' ],\n\t\t[    '3',     4,     5,     6,     7,     8,    '9' ],\n\t\t[   '10',    11,    12,    13,    14,    15,   '16' ],\n\t\t[   '17',    18,    19,    20,    21,    22,   '23' ],\n\t\t[   '24',    25,    26,    27,    28,    29,   '30' ],\n\t\t[   '31',    '',    '',    '',    '',    '',    ''  ]\n\t];\n}\n,\nfunction March_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',    '',    '',     1,    '2' ],\n\t\t[    '3',     4,     5,     6,     7,     8,    '9' ],\n\t\t[   '10',    11,    12,    13,    14,    15,   '16' ],\n\t\t[   '17',    18,    19,    20,    21,    22,   '23' ],\n\t\t[   '24',    25,    26,    27,    28,    '',    ''  ]\n\t];\n}\n,\nfunction April_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',     1,     2,     3,     4,     5,    '6' ],\n\t\t[    '7',     8,     9,    10,    11,    12,   '13' ],\n\t\t[   '14',    15,    16,    17,    18,    19,   '20' ],\n\t\t[   '21',    22,    23,    24,    25,    26,   '27' ],\n\t\t[   '28',    29,    30,    31,    '',    '',    ''  ]\n\t];\n}\n,\nfunction May_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',     1,     2,     3,    '4' ],\n\t\t[    '5',     6,     7,     8,     9,    10,   '11' ],\n\t\t[   '12',    13,    14,    15,    16,    17,   '18' ],\n\t\t[   '19',    20,    21,    22,    23,    24,   '25' ],\n\t\t[   '26',    27,    28,    29,    30,    '',    ''  ]\n\t];\n}\n,\nfunction June_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',    '',    '',    '',    '1' ],\n\t\t[    '2',     3,     4,     5,     6,     7,    '8' ],\n\t\t[    '9',    10,    11,    12,    13,    14,   '15' ],\n\t\t[   '16',    17,    18,    19,    20,    21,   '22' ],\n\t\t[   '23',    24,    25,    26,    27,    28,   '29' ],\n\t\t[   '30',    31,    '',    '',    '',    '',    ''  ]\n\t];\n}\n,\nfunction July_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',     1,     2,     3,     4,     5,    '6' ],\n\t\t[    '7',     8,     9,    10,    11,    12,   '13' ],\n\t\t[   '14',    15,    16,    17,    18,    19,   '20' ],\n\t\t[   '21',    22,    23,    24,    25,    26,   '27' ],\n\t\t[   '28',    29,    30,    '',    '',    '',    ''  ]\n\t];\n}\n,\nfunction August_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',    '',     1,     2,    '3' ],\n\t\t[    '4',     5,     6,     7,     8,     9,   '10' ],\n\t\t[   '11',    12,    13,    14,    15,    16,   '17' ],\n\t\t[   '18',    19,    20,    21,    22,    23,   '24' ],\n\t\t[   '25',    26,    27,    28,    29,    30,   '31' ]\n\t];\n}\n,\nfunction September_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[    '1',     2,     3,     4,     5,     6,    '7' ],\n\t\t[    '8',     9,    10,    11,    12,    13,   '14' ],\n\t\t[   '15',    16,    17,    18,    19,    20,   '21' ],\n\t\t[   '22',    23,    24,    25,    26,    27,   '28' ],\n\t\t[   '29',    30,    31,    '',    '',    '',    ''  ]\n\t];\n}\n,\nfunction October_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',     1,     2,     3,     4,    '5' ],\n\t\t[    '6',     7,     8,     9,    10,    11,   '12' ],\n\t\t[   '13',    14,    15,    16,    17,    18,   '19' ],\n\t\t[   '20',    21,    22,    23,    24,    25,   '26' ],\n\t\t[   '27',    28,    29,    30,    '',    '',    ''  ]\n\t];\n}\n,\nfunction November_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[     '',    '',    '',    '',    '',     1,    '2' ],\n\t\t[    '3',     4,     5,     6,     7,     8,    '9' ],\n\t\t[   '10',    11,    12,    13,    14,    15,   '16' ],\n\t\t[   '17',    18,    19,    20,    21,    22,   '23' ],\n\t\t[   '24',    25,    26,    27,    28,    29,   '30' ],\n\t\t[   '31',    '',    '',    '',    '',    '',    ''  ]\n\t];\n}\n,\nfunction December_2013() {\n\treturn [\n\t\t[  'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri',  'Sat' ],\n\t\t[    '1',     2,     3,     4,     5,     6,    '7' ],\n\t\t[    '8',     9,    10,    11,    12,    13,   '14' ],\n\t\t[   '15',    16,    17,    18,    19,    20,   '21' ],\n\t\t[   '22',    23,    24,    25,    26,    27,   '28' ],\n\t\t[   '29',    30,    '',    '',    '',    '',    ''  ]\n\t];\n}\n<\/pre>\n<p>\u0418 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440. <\/p>\n<pre>\nvar year = prompt(\"Enter year\", new Date().getFullYear()),\n\tcalendar = [],\n\tDAYS = {\n\t\tSUN: 0, MON: 1, TUE: 2, WED: 3, THU: 4, FRI: 5, SAT: 6\n\t},\n\tMONTHS = ['January', 'February', 'March', 'April', 'May', 'June', \n\t\t'July', 'August', 'September', 'October', 'November', 'December'];\nfor (var month = 0; month &lt; 12; month++) {\n\tvar firstDay = new Date(year, month, 1).getDay(),\n\t\tdays = new Date(year, month, 0).getDate(),\t\t\t\n\t\tlastDay = new Date(year, month, days).getDay(),\n\t\n\t\tstr = &quot;\\nfunction &quot; + MONTHS[month] + &quot;_&quot; + year + &quot;() &quot;;\n\tstr += &quot;{\\n\\treturn [\\n\\t\\t[  &#039;Sun&#039;, &#039;Mon&#039;, &#039;Tue&#039;, &#039;Wed&#039;, &#039;Thu&#039;, &#039;Fri&#039;,  &#039;Sat&#039; ],&quot;;\n\tif (firstDay !== DAYS.SUN) {\n\t\tstr += &quot;\\n\\t\\t[ &quot;; \n\t}\n\t\n\tfor(var emptyDay = DAYS.SUN; emptyDay &lt; firstDay; emptyDay++) {\n\t\tstr += &quot;    &#039;&#039;,&quot;;\n\t}\t\n\tfor (var day = 1; day &lt;= days; day++) {\n\t\tvar date = new Date(year, month, day);\n\t\tif (date.getDay() === DAYS.SUN) {\n\t\t\tstr += &quot;\\n\\t\\t[&quot;; \n\t\t}\t\t\n\t\tif (day \/ 10 &lt; 1) { \n\t\t\tstr += &quot; &quot;;\n\t\t}\n\t\tif (date.getDay() === DAYS.SUN || date.getDay() === DAYS.SAT) {\n\t\t\tstr += &quot;   &#039;&quot; + day + &quot;&#039;&quot;;\n\t\t} else {\n\t\t\tstr += &quot;    &quot; + day;\n\t\t}\n\t\tif (date.getDay() === DAYS.SAT) { \n\t\t\tstr += &quot; ]&quot;; \n\t\t\tif\t(day !== days) {\n\t\t\t\tstr += &quot;,&quot;;\n\t\t\t}\n\t\t} else {\n\t\t\tstr += &quot;,&quot;;\n\t\t}\n\t}\n\tfor (emptyDay = lastDay; emptyDay &lt; DAYS.SAT; emptyDay++) {\n\t\tstr += &quot;    &#039;&#039;&quot;;\n\t\tif(emptyDay !== DAYS.FRI) {\n\t\t\tstr+=&quot;,&quot;;\n\t\t}\n\t}\n\tif(lastDay !== DAYS.SAT) {\n\t\tstr+=&quot;  ]&quot;;\n\t}\n\tstr += &quot;\\n\\t];\\n}\\n&quot;;\n\tcalendar[month] = str;\n}\n\nvar pre = document.getElementsByTagName(&#039;pre&#039;)[0];\npre.innerHTML = calendar;\n<\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0433 pre \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 2013 \u0433\u043e\u0434 \u0438 \u043a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0433\u043e\u0434.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,20],"tags":[199],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-javascript","category-mycode","tag-kalendar"],"_links":{"self":[{"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/comments?post=175"}],"version-history":[{"count":0,"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"wp:attachment":[{"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infobase.athn.ru\/program\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}