Просмотр исходного кода

Merge pull request #233 from visuddhinanda/master

课程表
Bhikkhu-Kosalla 5 лет назад
Родитель
Сommit
d45814a3f8
100 измененных файлов с 1514 добавлено и 148 удалено
  1. 699 4
      app/calendar/index.html
  2. 62 58
      app/calendar/index1.html
  3. 0 0
      app/calendar/js/theme-chooser.js
  4. 0 0
      app/calendar/json/events.json
  5. 0 0
      app/calendar/php/get-events.php
  6. 0 0
      app/calendar/php/get-time-zones.php
  7. 0 0
      app/calendar/php/utils.php
  8. 1 74
      app/course/course.php
  9. 0 0
      app/fullcalendar/LICENSE.txt
  10. 0 0
      app/fullcalendar/README.md
  11. 0 0
      app/fullcalendar/examples/background-events.html
  12. 0 0
      app/fullcalendar/examples/daygrid-views.html
  13. 0 0
      app/fullcalendar/examples/external-dragging-2cals.html
  14. 0 0
      app/fullcalendar/examples/external-dragging-builtin.html
  15. 0 0
      app/fullcalendar/examples/full-height.html
  16. 0 0
      app/fullcalendar/examples/google-calendar.html
  17. 141 0
      app/fullcalendar/examples/js/theme-chooser.js
  18. 0 0
      app/fullcalendar/examples/json.html
  19. 228 0
      app/fullcalendar/examples/json/events.json
  20. 0 0
      app/fullcalendar/examples/list-sticky-header.html
  21. 0 0
      app/fullcalendar/examples/list-views.html
  22. 0 0
      app/fullcalendar/examples/locales.html
  23. 0 0
      app/fullcalendar/examples/month-view.html
  24. 0 0
      app/fullcalendar/examples/natural-height.html
  25. 0 0
      app/fullcalendar/examples/php/get-date.php
  26. 50 0
      app/fullcalendar/examples/php/get-events.php
  27. 9 0
      app/fullcalendar/examples/php/get-time-zones.php
  28. 130 0
      app/fullcalendar/examples/php/utils.php
  29. 0 0
      app/fullcalendar/examples/selectable.html
  30. 0 0
      app/fullcalendar/examples/theming.html
  31. 21 12
      app/fullcalendar/examples/time-zones.php
  32. 173 0
      app/fullcalendar/examples/time-zones1.php
  33. 0 0
      app/fullcalendar/examples/timegrid-sticky-header.html
  34. 0 0
      app/fullcalendar/examples/timegrid-views-hscroll.html
  35. 0 0
      app/fullcalendar/examples/timegrid-views.html
  36. 0 0
      app/fullcalendar/examples/week-numbers.html
  37. 0 0
      app/fullcalendar/lib/locales-all.js
  38. 0 0
      app/fullcalendar/lib/locales-all.min.js
  39. 0 0
      app/fullcalendar/lib/locales/af.js
  40. 0 0
      app/fullcalendar/lib/locales/ar-dz.js
  41. 0 0
      app/fullcalendar/lib/locales/ar-kw.js
  42. 0 0
      app/fullcalendar/lib/locales/ar-ly.js
  43. 0 0
      app/fullcalendar/lib/locales/ar-ma.js
  44. 0 0
      app/fullcalendar/lib/locales/ar-sa.js
  45. 0 0
      app/fullcalendar/lib/locales/ar-tn.js
  46. 0 0
      app/fullcalendar/lib/locales/ar.js
  47. 0 0
      app/fullcalendar/lib/locales/az.js
  48. 0 0
      app/fullcalendar/lib/locales/bg.js
  49. 0 0
      app/fullcalendar/lib/locales/bs.js
  50. 0 0
      app/fullcalendar/lib/locales/ca.js
  51. 0 0
      app/fullcalendar/lib/locales/cs.js
  52. 0 0
      app/fullcalendar/lib/locales/da.js
  53. 0 0
      app/fullcalendar/lib/locales/de.js
  54. 0 0
      app/fullcalendar/lib/locales/el.js
  55. 0 0
      app/fullcalendar/lib/locales/en-au.js
  56. 0 0
      app/fullcalendar/lib/locales/en-gb.js
  57. 0 0
      app/fullcalendar/lib/locales/en-nz.js
  58. 0 0
      app/fullcalendar/lib/locales/es-us.js
  59. 0 0
      app/fullcalendar/lib/locales/es.js
  60. 0 0
      app/fullcalendar/lib/locales/et.js
  61. 0 0
      app/fullcalendar/lib/locales/eu.js
  62. 0 0
      app/fullcalendar/lib/locales/fa.js
  63. 0 0
      app/fullcalendar/lib/locales/fi.js
  64. 0 0
      app/fullcalendar/lib/locales/fr-ca.js
  65. 0 0
      app/fullcalendar/lib/locales/fr-ch.js
  66. 0 0
      app/fullcalendar/lib/locales/fr.js
  67. 0 0
      app/fullcalendar/lib/locales/gl.js
  68. 0 0
      app/fullcalendar/lib/locales/he.js
  69. 0 0
      app/fullcalendar/lib/locales/hi.js
  70. 0 0
      app/fullcalendar/lib/locales/hr.js
  71. 0 0
      app/fullcalendar/lib/locales/hu.js
  72. 0 0
      app/fullcalendar/lib/locales/id.js
  73. 0 0
      app/fullcalendar/lib/locales/is.js
  74. 0 0
      app/fullcalendar/lib/locales/it.js
  75. 0 0
      app/fullcalendar/lib/locales/ja.js
  76. 0 0
      app/fullcalendar/lib/locales/ka.js
  77. 0 0
      app/fullcalendar/lib/locales/kk.js
  78. 0 0
      app/fullcalendar/lib/locales/ko.js
  79. 0 0
      app/fullcalendar/lib/locales/lb.js
  80. 0 0
      app/fullcalendar/lib/locales/lt.js
  81. 0 0
      app/fullcalendar/lib/locales/lv.js
  82. 0 0
      app/fullcalendar/lib/locales/mk.js
  83. 0 0
      app/fullcalendar/lib/locales/ms.js
  84. 0 0
      app/fullcalendar/lib/locales/nb.js
  85. 0 0
      app/fullcalendar/lib/locales/ne.js
  86. 0 0
      app/fullcalendar/lib/locales/nl.js
  87. 0 0
      app/fullcalendar/lib/locales/nn.js
  88. 0 0
      app/fullcalendar/lib/locales/pl.js
  89. 0 0
      app/fullcalendar/lib/locales/pt-br.js
  90. 0 0
      app/fullcalendar/lib/locales/pt.js
  91. 0 0
      app/fullcalendar/lib/locales/ro.js
  92. 0 0
      app/fullcalendar/lib/locales/ru.js
  93. 0 0
      app/fullcalendar/lib/locales/sk.js
  94. 0 0
      app/fullcalendar/lib/locales/sl.js
  95. 0 0
      app/fullcalendar/lib/locales/sq.js
  96. 0 0
      app/fullcalendar/lib/locales/sr-cyrl.js
  97. 0 0
      app/fullcalendar/lib/locales/sr.js
  98. 0 0
      app/fullcalendar/lib/locales/sv.js
  99. 0 0
      app/fullcalendar/lib/locales/th.js
  100. 0 0
      app/fullcalendar/lib/locales/tr.js

+ 699 - 4
app/calendar/index.html

@@ -3,6 +3,700 @@
 	<head>
 		<meta charset="utf-8" />
 		<link href="../lib/main.css" rel="stylesheet" />
+		<script src="../public/js/jquery.js"></script>
+		<script src="../public/js/comm.js"></script>
+		<script src="jquery-3.3.1.min.js"></script>
+		<script src="julian.js"></script>
+		<script src="lune.js"></script>
+		<script src="suncalc.js"></script>
+		<script src="./planet_position/js/planet-positions.js"></script>
+
+		<script src="../studio/js/fixedsticky.js"></script>
+		<script src="../guide/guide.js"></script>
+		<link type="text/css" rel="stylesheet" href="../guide/guide.css" />
+
+		<script src="../public/js/marked.js"></script>
+		<!--获取语言-->
+
+		<script>
+			var g_language = "en";
+			var g_currLink = "";
+			function lang_init(strPage) {
+				g_currLink = strPage;
+			}
+			function setLang(strLang) {
+				g_language = strLang;
+				setCookie("language", g_language, 365);
+				window.location.assign(location.pathname + "?language=" + g_language);
+			}
+		</script>
+		<script>
+			var localString = new Array();
+			localString["zh-cn"] = {
+				and_another: "又 ",
+				atitude: "纬度",
+				BE: "佛历",
+				bhumma: "周二",
+				budha: "周三",
+				canda: "周一",
+				confirm: "确认",
+				date: "日期",
+				day: "日",
+				days: "天 ",
+				departure_in_detail: "起飞详情",
+				dhamma_time: "会延续五千年的教法 ",
+				eat: "进餐",
+				gama_entry: "入村",
+				guru: "周四",
+				hori_ref_time: "蒙气差修正 ",
+				kala: "适当的时间",
+				language_select: "选择语言",
+				left: "还剩下",
+				loading: "载入中……",
+				longitude: "经度",
+				māsa: "月",
+				mins: "分钟",
+				month: "月 ",
+				month_1: "月 ",
+				months: "个月 ",
+				my_loc: "我的位置",
+				need_inform: "未告知其他比库",
+				no_string: "不能",
+				noon_time: "正午",
+				noon_time: "正午",
+				note: "注释",
+				now_time: "现在",
+				pacchā_māsa: "下个月",
+				pakkha: "月相变化 ",
+				past: "已过去",
+				pubba_māsa: "上个月",
+				ravi: "周日",
+				saṃvacchara: "年",
+				season: "季节 ",
+				sec: "秒",
+				sora: "周六",
+				sukka: "周五",
+				sun_height_degree: "正午太阳高度 ",
+				time: "时间",
+				twilight_time: "曙光",
+				twilight_time: "曙光",
+				vikala: "不适当的时间",
+				week_day: "星期",
+				year_0: "年",
+				year_1: "年 ",
+				years: "年 ",
+				yes_string: "可以",
+			};
+			localString["zh-tw"] = {
+				and_another: "又 ",
+				atitude: "緯度",
+				BE: "佛曆",
+				bhumma: "週二",
+				budha: "週三",
+				canda: "週一",
+				confirm: "確認",
+				date: "日期",
+				day: "日",
+				days: "天 ",
+				departure_in_detail: "起飛詳情",
+				dhamma_time: "會延續五千年的教法 ",
+				eat: "進餐",
+				gama_entry: "入村",
+				guru: "週四",
+				hori_ref_time: "蒙氣差修正 ",
+				kala: "適當的時間",
+				language_select: "選擇語言",
+				left: "還剩下",
+				loading: "載入中……",
+				longitude: "經度",
+				māsa: "月",
+				mins: "分鐘",
+				month: "月 ",
+				month_1: "月 ",
+				months: "個月 ",
+				my_loc: "我的位置",
+				need_inform: "未告知其他比庫",
+				no_string: "不能",
+				noon_time: "正午",
+				noon_time: "正午",
+				note: "註釋",
+				now_time: "現在",
+				pacchā_māsa: "下個月",
+				pakkha: "月相變化 ",
+				past: "已過去",
+				pubba_māsa: "上個月",
+				ravi: "週日",
+				saṃvacchara: "年",
+				season: "季節 ",
+				sec: "秒",
+				sora: "週六",
+				sukka: "週五",
+				sun_height_degree: "正午太陽高度 ",
+				time: "時間",
+				twilight_time: "曙光",
+				twilight_time: "曙光",
+				vikala: "不適當的時間",
+				week_day: "星期",
+				year_0: "年",
+				year_1: "年 ",
+				years: "年 ",
+				yes_string: "可以",
+			};
+			localString["default"] = {
+				and_another: " and ",
+				atitude: "Atitude",
+				BE: "Buddhist Era ",
+				bhumma: "Bhumma",
+				budha: "Budha",
+				canda: "Canda",
+				confirm: "Confirm",
+				date: "Date ",
+				day: " day(s) ",
+				days: " day(s) ",
+				departure_in_detail: "departure in detail",
+				dhamma_time: "5000 Years of the Buddha’s Dispensation ",
+				eat: "eat",
+				gama_entry: "entry the village",
+				guru: "Guru",
+				hori_ref_time: "horizontal refraction correct ",
+				kala: "suitable time",
+				language_select: "bhāsā",
+				left: "Remains ",
+				loading: "loading…",
+				longitude: "Longitude",
+				māsa: "māsa",
+				mins: "(min)",
+				month: "Month ",
+				month_1: "- ",
+				months: " month(s) ",
+				my_loc: "attasmiṃ",
+				need_inform: "without informing other Bhikkhu ",
+				no_string: "cannot ",
+				noon_time: "NOON",
+				noon_time: "NOON",
+				note: "Note",
+				now_time: "NOW",
+				pacchā_māsa: "pacchā-māsa",
+				pakkha: "Lunar Phases ",
+				past: "Passed ",
+				pubba_māsa: "pubba-māsa",
+				ravi: "Ravi",
+				saṃvacchara: "saṃvacchara",
+				season: "Season ",
+				sec: "sec ",
+				sora: "Sora",
+				sukka: "Sukka",
+				sun_height_degree: "Max solar altitude ",
+				time: "Time",
+				twilight_time: "dawn",
+				twilight_time: "dawn",
+				vikala: "unsuitable time",
+				week_day: "Day",
+				year_0: "saṃvacchara",
+				year_1: "- ",
+				years: " year(s) ",
+				yes_string: "can ",
+			};
+			localString["en"] = {
+				and_another: " and ",
+				atitude: "Atitude",
+				BE: "Buddhist Era ",
+				bhumma: "Bhumma",
+				budha: "Budha",
+				canda: "Canda",
+				confirm: "Confirm",
+				date: "Date",
+				day: " day(s) ",
+				days: " day(s) ",
+				departure_in_detail: "departure in detail",
+				dhamma_time: "5000 Years of the Buddha’s Dispensation ",
+				eat: "eat",
+				gama_entry: "entry the village",
+				guru: "Guru",
+				hori_ref_time: "horizontal refraction correct ",
+				kala: "suitable time",
+				language_select: "Language",
+				left: "Remains ",
+				loading: "loading…",
+				longitude: "Longitude",
+				māsa: "māsa",
+				mins: "(min)",
+				month: "Month ",
+				month_1: "- ",
+				months: " month(s) ",
+				my_loc: "my location",
+				need_inform: "without informing other Bhikkhu ",
+				no_string: "cannot ",
+				noon_time: "NOON",
+				noon_time: "NOON",
+				note: "Note",
+				now_time: "NOW",
+				pacchā_māsa: "pacchā-māsa",
+				pakkha: "Lunar Phases ",
+				past: "Passed ",
+				pubba_māsa: "pubba-māsa",
+				ravi: "Ravi",
+				saṃvacchara: "saṃvacchara",
+				season: "Season ",
+				sec: "sec",
+				sora: "Sora",
+				sukka: "Sukka",
+				sun_height_degree: "Max solar altitude ",
+				time: "time",
+				twilight_time: "dawn",
+				twilight_time: "dawn",
+				vikala: "unsuitable time",
+				week_day: "Day",
+				year_0: "year",
+				year_1: "- ",
+				years: " year(s) ",
+				yes_string: "can ",
+			};
+			localString["my"] = {
+				and_another: " and ",
+				atitude: "Atitude",
+				BE: "Buddhist Era ",
+				bhumma: "ဘုမ္မ",
+				budha: "ဗုဓ",
+				canda: "စန္ဒ",
+				confirm: "Confirm",
+				date: "Date ",
+				day: " day(s) ",
+				days: " day(s) ",
+				departure_in_detail: "departure in detail",
+				dhamma_time: "5000 Years of the Buddha’s Dispensation ",
+				eat: "eat",
+				gama_entry: "entry the village",
+				guru: "ဂုရု",
+				hori_ref_time: "horizontal refraction correct ",
+				kala: "ကာလ",
+				language_select: "ဘာသာ",
+				left: "Remains ",
+				loading: "loading…",
+				longitude: "Longitude",
+				māsa: "မာသ",
+				mins: "(min)",
+				month: "Month ",
+				month_1: "- ",
+				months: " month(s) ",
+				my_loc: "အတ္တသ္မိံ",
+				need_inform: "without informing other Bhikkhu ",
+				no_string: "cannot ",
+				noon_time: "မဇ္ဈန္ဟိက",
+				noon_time: "မဇ္ဈန္ဟိက",
+				note: "Note",
+				now_time: "ပစ္စုပ္ပန္န",
+				pacchā_māsa: "ပစ္ဆာ-မာသ",
+				pakkha: "Lunar Phases ",
+				past: "Passed ",
+				pubba_māsa: "ပုဗ္ဗ-မာသ",
+				ravi: "ရဝိ",
+				saṃvacchara: "သံဝစ္ဆရ",
+				season: "Season ",
+				sec: "sec ",
+				sora: "သောရ",
+				sukka: "သုက္က",
+				sun_height_degree: "Max solar altitude ",
+				time: "Time",
+				twilight_time: "အရုဏုဂ္ဂမန",
+				twilight_time: "အရုဏုဂ္ဂမန",
+				vikala: "ဝိကာလ",
+				week_day: "Day",
+				year_0: "year",
+				year_1: "- ",
+				years: " year(s) ",
+				yes_string: "can ",
+			};
+			localString["si"] = {
+				and_another: " ච ",
+				atitude: "Atitude",
+				BE: "බුද්ධ වර්ෂය ",
+				bhumma: "භුම්ම",
+				budha: "බුධ",
+				canda: "චන්ද",
+				confirm: "Confirm",
+				date: "දිවස ",
+				day: " දිවසා(නි) ",
+				days: " දිවසා(නි) ",
+				departure_in_detail: "departure in detail",
+				dhamma_time: "සම්මා සම්බුද්ධස්ස සාසනං පට්ච-වස්ස-සහස්සානි පවත්තිස්සති ",
+				eat: "eat",
+				gama_entry: "entry the village",
+				guru: "ගු‍රු",
+				hori_ref_time: "horizontal refraction correct ",
+				kala: "කාල",
+				language_select: "භාෂාව",
+				left: "අවසිට්ඨ ",
+				loading: "ප්‍රවේශනය වෙනවා ",
+				longitude: "Longitude",
+				māsa: "මාස",
+				mins: "(min)",
+				month: "මාස ",
+				month_1: "- ",
+				months: " මාසා(නි) ",
+				my_loc: "අත‍්තස‍්මිං",
+				need_inform: "without informing other Bhikkhu ",
+				no_string: "cannot ",
+				noon_time: "මජ්ඣන්හික",
+				noon_time: "මජ්ඣන්හික",
+				note: "නෝට්ටුව ",
+				now_time: "පච්චුප්පන්න",
+				pacchā_māsa: "පච්ඡා-මාස",
+				pakkha: "පක්ඛ ",
+				past: "අතික්කන්ත ",
+				pubba_māsa: "පුබ්බ-මාස",
+				ravi: "රවි",
+				saṃvacchara: "සංවච්ඡ‍ර",
+				season: "උතු ",
+				sec: "sec",
+				sora: "සො‍ර",
+				sukka: "සුක්ක",
+				sun_height_degree: "Max solar altitude ",
+				time: "time",
+				twilight_time: "අ‍රුණුග්ගමන",
+				twilight_time: "අ‍රුණුග්ගමන",
+				vikala: "විකාල",
+				week_day: "වා‍ර ",
+				year_0: "සංවච්ඡ‍ර",
+				year_1: "- ",
+				years: " සංවච්ඡ‍රා(නි) ",
+				yes_string: "can ",
+			};
+			var pali_month_name = [
+				{ id: "1", value: "jeṭṭha", season: "gimhāna", season_icon: "☀" }, //5.X-四-十五-心
+				{ id: "2", value: "asāḷha", season: "gimhāna", season_icon: "☀" }, //6.X-五-十五、十六-箕、斗
+				{ id: "3", value: "sāvana", season: "vassāna", season_icon: "☔" }, //7.X-六-十五-女
+				{ id: "4", value: "poṭṭhapāda", season: "vassāna", season_icon: "☔" }, //8.x-七-十五、十六-室、壁
+				{ id: "5", value: "assajuja", season: "vassāna", season_icon: "☔" }, //9.X-八-十五-樓
+				{ id: "6", value: "kattika", season: "vassāna", season_icon: "☔" }, //10.X-九-十五-昂
+				{ id: "7", value: "māgasira", season: "hemanta", season_icon: "❄" }, //11.X-十-十五-觜
+				{ id: "8", value: "phussa", season: "hemanta", season_icon: "❄" }, //12.X-十一-十五-鬼
+				{ id: "9", value: "māgha", season: "hemanta", season_icon: "❄" }, //1.X-十二-十五-星
+				{ id: "10", value: "phagguna", season: "hemanta", season_icon: "❄" }, //2.X-正月-十四、十五-張、異
+				{ id: "11", value: "citta", season: "gimhāna", season_icon: "☀" }, //3.X-二月-十五-角
+				{ id: "12", value: "vesākha", season: "gimhāna", season_icon: "☀" }, //4.X-三月-十五-氐
+			];
+			var pali_nakkhatta_name = [
+				{ id: "0", value: "assayuja", name_zh: "娄宿" },
+				{ id: "1", value: "bharaṇī", name_zh: "胃宿" },
+				{ id: "2", value: "Kattikā", name_zh: "昂宿" },
+				{ id: "3", value: "rohiṇī", name_zh: "毕宿" },
+				{ id: "4", value: "magasira", name_zh: "觜宿" },
+				{ id: "5", value: "Addā", name_zh: "参宿" },
+				{ id: "6", value: "punabbasu", name_zh: "井宿" },
+				{ id: "7", value: "phussa", name_zh: "鬼宿" },
+				{ id: "8", value: "Asilesā", name_zh: "柳宿" },
+				{ id: "9", value: "maghā", name_zh: "星宿" },
+				{ id: "10", value: "pubbaphagguṇī", name_zh: "张宿" },
+				{ id: "11", value: "uttaraphagguṇī", name_zh: "翼宿" },
+				{ id: "12", value: "hattha", name_zh: "轸宿" },
+				{ id: "13", value: "cittā", name_zh: "角宿" },
+				{ id: "14", value: "sāti", name_zh: "亢宿" },
+				{ id: "15", value: "visākhā", name_zh: "氐宿" },
+				{ id: "16", value: "anurādhā", name_zh: "房宿" },
+				{ id: "17", value: "jeṭṭha", name_zh: "心宿" },
+				{ id: "18", value: "mūlā", name_zh: "尾宿" },
+				{ id: "19", value: "pubbāsāḷha", name_zh: "箕宿" },
+				{ id: "20", value: "uttarāsāḷha", name_zh: "斗宿" },
+				{ id: "21", value: "savaṇa", name_zh: "女宿" },
+				{ id: "22", value: "dhaniṭṭhā", name_zh: "虚宿" },
+				{ id: "23", value: "satabhisaja", name_zh: "危宿" },
+				{ id: "24", value: "pubbabhaddapadā", name_zh: "室宿" },
+				{ id: "25", value: "uttarabhaddapadā", name_zh: "壁宿" },
+				{ id: "26", value: "revatī", name_zh: "奎宿" },
+			];
+			var horoscope_name = [
+				{ id: "0", value: "Aries", name_zh: "白羊", icon: "♈" },
+				{ id: "1", value: "Taurus", name_zh: "金牛", icon: "♉" },
+				{ id: "2", value: "Gemini", name_zh: "双子", icon: "♊" },
+				{ id: "3", value: "Cancer", name_zh: "巨蟹", icon: "♋" },
+				{ id: "4", value: "Leo", name_zh: "狮子", icon: "♌" },
+				{ id: "5", value: "Virgo", name_zh: "处女", icon: "♍" },
+				{ id: "6", value: "Libra", name_zh: "天秤", icon: "♎" },
+				{ id: "7", value: "Scorpio", name_zh: "天蝎", icon: "♏" },
+				{ id: "8", value: "Sagittarius", name_zh: "射手", icon: "♐" },
+				{ id: "9", value: "Capricornus", name_zh: "摩羯", icon: "♑" },
+				{ id: "10", value: "Aquarius", name_zh: "水瓶", icon: "♒" },
+				{ id: "11", value: "Pisces", name_zh: "双鱼", icon: "♓" },
+			];
+		</script>
+		<script>
+			var current_phase = phase();
+			console.log(current_phase); //输出到控制台
+
+			//$("#title_text").html(localString[g_language].BE);
+			var new_list = new Array(); //新月列表
+			var first_list = new Array(); //上弦月列表
+			var full_list = new Array(); //满月列表
+			var last_list = new Array(); //下弦月列表
+			var planets = new Array(); //
+			var lunar_position = new Object();
+
+			var g_coordinate_this = new Object();
+			var g_now_date = new Date();
+			var today = new Date();
+			var start_day = new Date();
+			var next_year = new Date();
+			var sun_times = new Object();
+
+			var curr_position = localStorage.getItem("local_position");
+			if (curr_position) {
+				g_coordinate_this.AT = curr_position.split("#")[0];
+				g_coordinate_this.LT = curr_position.split("#")[1];
+				g_coordinate_this.height = curr_position.split("#")[2];
+				if (g_coordinate_this.AT >= 0) {
+					var AT_string = angle_trans(g_coordinate_this.AT) + "N";
+				} else {
+					var AT_string = angle_trans(g_coordinate_this.AT) + "S";
+				}
+				if (g_coordinate_this.LT >= 0) {
+					var LT_string = angle_trans(g_coordinate_this.LT) + "E";
+				} else {
+					var LT_string = angle_trans(g_coordinate_this.LT) + "W";
+				}
+				let height_string = g_coordinate_this.height + "M";
+				$("#selected_position_string").html(AT_string + " " + LT_string + " " + height_string);
+			} else {
+				getLocation();
+			}
+			function show_time() {
+				if ($("#input_time").val()) {
+					today = new Date($("#input_time").val());
+				} else {
+					today = g_now_date;
+				}
+				if (phase(today).phase <= 0.5) {
+					start_day.setDate(today.getDate() - 16); //退到本月的新月之前
+					start_day = phaseHunt(start_day).full_date; //得到之前最近的满月日
+					start_day.setDate(start_day.getDate() + 1);
+				} else {
+					start_day.setDate(today.getDate() - 31); //退到本月的新月之前
+					start_day = phaseHunt(start_day).full_date; //得到之前最近的满月日
+					start_day.setDate(start_day.getDate() + 1);
+				}
+				next_year.setDate(start_day.getDate() + 360);
+
+				last_list = phaseRange(start_day, next_year, LAST); //获取下弦月列表
+				new_list = phaseRange(start_day, next_year, NEW); //获取新月列表
+				first_list = phaseRange(start_day, next_year, FIRST); //获取上弦月列表
+				full_list = phaseRange(start_day, next_year, FULL); //获取满月列表
+
+				console.log(last_list); //输出到控制台
+				console.log(new_list); //输出到控制台
+				console.log(first_list); //输出到控制台
+				console.log(full_list); //输出到控制台
+				lunar_phase_list_refresh();
+				get_position(today);
+
+				let d_earth_to_moon =
+					lunar_position.position.x ^
+					(2 + lunar_position.position.y) ^
+					(2 + lunar_position.position.z) ^
+					2 ^
+					0.5;
+				let d_earth_to_moon_0 = phase(today).distance;
+
+				sun_times = SunCalc.getTimes(
+					today,
+					g_coordinate_this.AT,
+					g_coordinate_this.LT,
+					g_coordinate_this.height / 1000
+				);
+				sun_position = SunCalc.getPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
+				moon_position = SunCalc.getMoonPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
+				moon_Illumination = SunCalc.getMoonIllumination(today);
+				$("#today_dawn").html(sun_times.dawn.toLocaleTimeString()); //破晓
+				$("#today_solarNoon").html(sun_times.solarNoon.toLocaleTimeString()); //正午
+				$("#today_sunset").html(sun_times.sunset.toLocaleTimeString()); //日落
+				$("#today_sun_azimuth").html(angle_trans((sun_position.azimuth / Math.PI) * 180)); //太阳水平弧度
+				$("#today_moon_azimuth").html(angle_trans((moon_position.azimuth / Math.PI) * 180)); //月亮水平弧度
+				$("#today_moon_phase").html(phase(today).phase); //月相值
+				$("#today_moon_percent").html(phase(today).illuminated); //月照度
+				$("#today_moon_angle").html(angle_trans((moon_Illumination.angle / Math.PI) * 180)); //月相角
+				$("#angle_sun_e_moon").html(
+					angle_trans((Math.abs(Math.PI + sun_position.azimuth - moon_position.azimuth) / Math.PI) * 180)
+				); //月亮水平弧度
+				$("#curr_time").html(today.toLocaleTimeString()); //当前时间
+				$("#now_time").html(g_now_date.toLocaleTimeString()); //现在
+				$("#curr_time_unix").html(today.getTime()); //時間戳
+
+				let earth_angle_string = "";
+				earth_angle_string += get_position(today).solar_position_angle + "——";
+				earth_angle_string += get_position(today).solar_position_angle_round + "——";
+				earth_angle_string += get_position(today).solar_station + "——";
+				earth_angle_string += get_station_name(today).solar.icon;
+				$("#earth_angle").html(earth_angle_string); //地球角度
+
+				let moon_angle_string = "";
+				moon_angle_string += get_position(today).lunar_position_angle + "——";
+				moon_angle_string += get_position(today).lunar_position_angle_round + "——";
+				moon_angle_string += get_position(today).lunar_station + "——";
+				moon_angle_string += get_station_name(today).lunar.value;
+				$("#moon_angle").html(moon_angle_string); //月亮角度——角度差算法
+
+				let moon_angle_string2 = "";
+				moon_angle_string2 += get_position(today).lunar_position_angle2 + "——";
+				moon_angle_string2 += get_position(today).lunar_position_angle_round2 + "——";
+				moon_angle_string2 += get_position(today).lunar_station2 + "——";
+				moon_angle_string2 += get_station_name(today).lunar.value;
+				$("#moon_angle2").html(moon_angle_string2); //月亮角度——向量差算法
+			}
+			//根据时间计算偏角,输出
+			function get_position(date_time) {
+				let planets_position = new Object();
+				planets = window.lagrange.planet_positions.getPositions(date_time);
+				//planets = global.planet_positions.getPositions(today);
+				//console.log(planets)//输出到控制台
+				earth_position = window.lagrange.planet_positions.getPositions(date_time)[3];
+				lunar_position = window.lagrange.planet_positions.getPositions(date_time)[11];
+				let lunar_position_angle = 0;
+				let lunar_station = 0;
+				let earth_position_angle = 0;
+				let earth_station = 0;
+				let earth_position_angle_round = 0;
+				let lunar_position_angle_round = 0;
+				//太阳相对地球的黄道偏角
+				if (earth_position.position.y >= 0) {
+					earth_position_angle = Math.atan2(earth_position.position.y, earth_position.position.x);
+				} else {
+					earth_position_angle =
+						Math.PI * 2 + Math.atan2(earth_position.position.y, earth_position.position.x);
+				}
+				earth_position_angle_round = earth_position_angle / Math.PI / 2 + 0.5;
+				earth_position_angle_round = earth_position_angle_round - Math.floor(earth_position_angle_round);
+				earth_station = earth_position_angle_round * 12;
+				planets_position.solar_station = earth_station;
+				planets_position.solar_position_angle = earth_position_angle_round * Math.PI * 2;
+				planets_position.solar_position_angle_round = earth_position_angle_round;
+				//月球相对地球的黄道偏角——角度差算法
+				lunar_position_angle_round = earth_position_angle_round + phase(date_time).phase;
+				lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round);
+				lunar_position_angle = lunar_position_angle_round * Math.PI * 2;
+				lunar_station = lunar_position_angle_round * 27;
+				//月球相对地球的黄道偏角算法——向量差算法
+				let lunar_to_earth = new Object();
+				lunar_to_earth.y = lunar_position.position.y - earth_position.position.y;
+				lunar_to_earth.x = lunar_position.position.x - earth_position.position.x;
+				if (lunar_to_earth.y >= 0) {
+					lunar_position_angle2 = Math.atan2(lunar_to_earth.y, lunar_to_earth.x);
+				} else {
+					lunar_position_angle2 = Math.PI * 2 + Math.atan2(lunar_to_earth.y, lunar_to_earth.x);
+				}
+				lunar_position_angle_round2 = lunar_position_angle2 / Math.PI / 2;
+				//lunar_position_angle_round = lunar_position_angle_round - Math.floor(lunar_position_angle_round)
+				lunar_position_angle2 = lunar_position_angle_round2 * Math.PI * 2;
+
+				lunar_station2 = lunar_position_angle_round2 * 27;
+
+				planets_position.lunar_station = lunar_station; //月站值【角度差算夹角】
+				planets_position.lunar_position_angle = lunar_position_angle; //月站角【角度差算夹角】
+				planets_position.lunar_position_angle_round = lunar_position_angle_round; //月站圆周比率【角度差算夹角】
+				planets_position.lunar_station2 = lunar_station2; //月站值【矢量差算夹角】
+				planets_position.lunar_position_angle2 = lunar_position_angle2; //月站角【矢量差算夹角】
+				planets_position.lunar_position_angle_round2 = lunar_position_angle_round2; //月站圆周比率【矢量差算夹角】
+				return planets_position;
+			}
+			//根据;
+			function get_station_name(data_time) {
+				//获取星象信息
+				let solar_num = 0;
+				let lunar_num = 0;
+				solar_num = get_position(data_time).solar_station;
+				solar_num = Math.floor(solar_num);
+				lunar_num = get_position(data_time).lunar_station;
+				lunar_num = Math.floor(lunar_num);
+
+				let result = new Object();
+				result.solar = horoscope_name[solar_num]; //黄道十二宫星象名称
+				result.lunar = pali_nakkhatta_name[lunar_num]; //27星宿月站名称
+				return result;
+			}
+			function getLocation() {
+				//自动定位
+				if (navigator.geolocation) {
+					navigator.geolocation.getCurrentPosition(showPosition, showError);
+				} else {
+					$("#selected_position_string").html("Geolocation is not supported by this browser.");
+				}
+			}
+			function showPosition(position) {
+				alert("get cordinate success");
+				g_coordinate_this.AT = position.coords.latitude; //纬度
+				g_coordinate_this.LT = position.coords.longitude; //经度
+				g_coordinate_this.height = position.coords.altitude; //海拔高度
+				//手动输入
+				var LT = Number($("#LT_°")[0].value);
+				LT += Number($("#LT_’")[0].value) / 60;
+				LT += Number($("#LT_”")[0].value) / 3600;
+				LT = Number($("#WE")[0].value + LT);
+				var AT = Number($("#AT_°")[0].value);
+				AT += Number($("#AT_’")[0].value) / 60;
+				AT += Number($("#AT_”")[0].value) / 3600;
+				AT = Number($("#NS")[0].value + AT);
+				if (AT != 0) {
+					g_coordinate_this.LT = LT;
+					g_coordinate_this.AT = AT;
+				}
+
+				let position_string =
+					g_coordinate_this.AT + "#" + g_coordinate_this.LT + "#" + g_coordinate_this.height;
+				localStorage.setItem("local_position", position_string);
+
+				if (g_coordinate_this.AT >= 0) {
+					var AT_string = angle_trans(g_coordinate_this.AT) + "N";
+				} else {
+					var AT_string = angle_trans(g_coordinate_this.AT) + "S";
+				}
+				if (g_coordinate_this.LT >= 0) {
+					var LT_string = angle_trans(g_coordinate_this.LT) + "E";
+				} else {
+					var LT_string = angle_trans(g_coordinate_this.LT) + "W";
+				}
+				let height_string = g_coordinate_this.height + "M";
+				$("#selected_position_string").html(AT_string + " " + LT_string + " " + height_string);
+				$("#position_input").hide();
+			}
+			function showError(error) {
+				switch (error.code) {
+					case error.PERMISSION_DENIED:
+						alert("定位失败,用户拒绝请求地理定位");
+						break;
+					case error.POSITION_UNAVAILABLE:
+						alert("定位失败,位置信息是不可用");
+						break;
+					case error.TIMEOUT:
+						alert("定位失败,请求获取用户位置超时");
+						break;
+					case error.UNKNOWN_ERROR:
+						alert("定位失败,定位系统失效");
+						break;
+				}
+			}
+			function angle_trans(angle) {
+				var angle_str = "";
+				var num_d = Math.floor(angle);
+				var num_m = Math.floor((angle - num_d) * 60);
+				var num_s = Math.round((angle - num_d) * 60 - num_m);
+				if (num_d != 0) {
+					angle_str += num_d + "°";
+				}
+				if (num_m != 0) {
+					angle_str += num_m + "’";
+				}
+				if (num_s != 0) {
+					angle_str += num_s + "”";
+				}
+				return angle_str;
+			}
+			function input_position() {
+				$("#position_input").show();
+			}
+			var g_event_list_arr = new Array();
+			function get_event_arr() {
+				let from_str = new Date();
+				let info_obj = new Object();
+			}
+		</script>
 		<script src="../lib/main.js"></script>
 		<script>
 			function getCookie(name) {
@@ -36,11 +730,12 @@
 					editable: true,
 					selectable: true,
 					dayMaxEvents: true, // allow "more" link when too many events
+					resources: g_event_list_arr,
 					events: {
-						url: "php/get-events.php",
-						failure: function () {
-							document.getElementById("script-warning").style.display = "inline"; // show
-						},
+						/*url: "php/get-events.php",
+							failure: function () {
+								document.getElementById("script-warning").style.display = "inline"; // show
+							},*/
 					},
 					eventClick: function (info) {
 						info.jsEvent.preventDefault(); // don't let the browser navigate

+ 62 - 58
app/calendar/index1.html

@@ -464,7 +464,7 @@
 			.correct {
 				background-color: gold;
 			}
-			#position_input{
+			#position_input {
 				width: fit-content;
 				background: #dfdfdf;
 				padding: 1em;
@@ -474,11 +474,10 @@
 				left: 5em;
 				top: 10em;
 			}
-			#position_input input[type="number" i]{
+			#position_input input[type="number" i] {
 				width: 4em;
 			}
 			#position_input span {
-
 			}
 			#position_input select {
 				width: 3.5em;
@@ -513,37 +512,43 @@
 					//localString[g_language].my_loc
 				</script>
 			</button>
-			<div id="position_input" style="display:none;">
-				<div style="display:flex;"><span style="flex: 3;justify-content: flex-end;display: flex;margin: auto 1em auto 0;">
-					<script>
-						document.write(localString[g_language].atitude);
-					</script></span><span style="flex:7;white-space: nowrap;">
-					<input id="AT_°" type="number" min="0" max="90" /> °
-					<input id="AT_’" type="number" min="0" max="60" /> ’
-					<input id="AT_”" type="number" min="0" max="60" /> ”
-					<select id="NS">
-						<option value="+">N</option>
-						<option value="-">S</option>
-					</select></span>
+			<div id="position_input" style="display: none">
+				<div style="display: flex">
+					<span style="flex: 3; justify-content: flex-end; display: flex; margin: auto 1em auto 0">
+						<script>
+							document.write(localString[g_language].atitude);
+						</script></span
+					><span style="flex: 7; white-space: nowrap">
+						<input id="AT_°" type="number" min="0" max="90" /> °
+						<input id="AT_’" type="number" min="0" max="60" /> ’
+						<input id="AT_”" type="number" min="0" max="60" /> ”
+						<select id="NS">
+							<option value="+">N</option>
+							<option value="-">S</option>
+						</select></span
+					>
 				</div>
-				<div style="display:flex;">
-					<span style="flex: 3;justify-content: flex-end;display: flex;margin: auto 1em auto 0;"><script>
-						document.write(localString[g_language].longitude);
-					</script></span><span style="flex:7;white-space: nowrap;">
-					<input id="LT_°" type="number" min="0" max="180" /> °
-					<input id="LT_’" type="number" min="0" max="60" /> ’
-					<input id="LT_”" type="number" min="0" max="60" /> ”
-					<select id="WE">
-						<option value="+">E</option>
-						<option value="-">W</option>
-					</select></span>
+				<div style="display: flex">
+					<span style="flex: 3; justify-content: flex-end; display: flex; margin: auto 1em auto 0"
+						><script>
+							document.write(localString[g_language].longitude);
+						</script></span
+					><span style="flex: 7; white-space: nowrap">
+						<input id="LT_°" type="number" min="0" max="180" /> °
+						<input id="LT_’" type="number" min="0" max="60" /> ’
+						<input id="LT_”" type="number" min="0" max="60" /> ”
+						<select id="WE">
+							<option value="+">E</option>
+							<option value="-">W</option>
+						</select></span
+					>
 				</div>
 				<div id="position_selected"></div>
-				<div style="display:flex;">
-					<button onclick="getLocation()" style="margin:0 auto;">
-					<script>
-						document.write(localString[g_language].confirm);
-					</script>
+				<div style="display: flex">
+					<button onclick="getLocation()" style="margin: 0 auto">
+						<script>
+							document.write(localString[g_language].confirm);
+						</script>
 					</button>
 				</div>
 			</div>
@@ -658,9 +663,9 @@
 				sun_position = SunCalc.getPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
 				moon_position = SunCalc.getMoonPosition(today, g_coordinate_this.AT, g_coordinate_this.LT);
 				moon_Illumination = SunCalc.getMoonIllumination(today);
-				$("#today_dawn").html(sun_times.dawn.toLocaleTimeString());
-				$("#today_solarNoon").html(sun_times.solarNoon.toLocaleTimeString());
-				$("#today_sunset").html(sun_times.sunset.toLocaleTimeString());
+				$("#today_dawn").html(sun_times.dawn.toLocaleTimeString()); //破晓
+				$("#today_solarNoon").html(sun_times.solarNoon.toLocaleTimeString()); //正午
+				$("#today_sunset").html(sun_times.sunset.toLocaleTimeString()); //日落
 				$("#today_sun_azimuth").html(angle_trans((sun_position.azimuth / Math.PI) * 180)); //太阳水平弧度
 				$("#today_moon_azimuth").html(angle_trans((moon_position.azimuth / Math.PI) * 180)); //月亮水平弧度
 				$("#today_moon_phase").html(phase(today).phase); //月相值
@@ -694,6 +699,7 @@
 				moon_angle_string2 += get_station_name(today).lunar.value;
 				$("#moon_angle2").html(moon_angle_string2); //月亮角度——向量差算法
 			}
+			//根据时间计算偏角,输出
 			function get_position(date_time) {
 				let planets_position = new Object();
 				planets = window.lagrange.planet_positions.getPositions(date_time);
@@ -740,14 +746,15 @@
 
 				lunar_station2 = lunar_position_angle_round2 * 27;
 
-				planets_position.lunar_station = lunar_station;
-				planets_position.lunar_position_angle = lunar_position_angle;
-				planets_position.lunar_position_angle_round = lunar_position_angle_round;
-				planets_position.lunar_station2 = lunar_station2;
-				planets_position.lunar_position_angle2 = lunar_position_angle2;
-				planets_position.lunar_position_angle_round2 = lunar_position_angle_round2;
+				planets_position.lunar_station = lunar_station; //月站值【角度差算夹角】
+				planets_position.lunar_position_angle = lunar_position_angle; //月站角【角度差算夹角】
+				planets_position.lunar_position_angle_round = lunar_position_angle_round; //月站圆周比率【角度差算夹角】
+				planets_position.lunar_station2 = lunar_station2; //月站值【矢量差算夹角】
+				planets_position.lunar_position_angle2 = lunar_position_angle2; //月站角【矢量差算夹角】
+				planets_position.lunar_position_angle_round2 = lunar_position_angle_round2; //月站圆周比率【矢量差算夹角】
 				return planets_position;
 			}
+			根据;
 			function get_station_name(data_time) {
 				//获取星象信息
 				let solar_num = 0;
@@ -758,8 +765,8 @@
 				lunar_num = Math.floor(lunar_num);
 
 				let result = new Object();
-				result.solar = horoscope_name[solar_num];
-				result.lunar = pali_nakkhatta_name[lunar_num];
+				result.solar = horoscope_name[solar_num]; //黄道十二宫星象名称
+				result.lunar = pali_nakkhatta_name[lunar_num]; //27星宿月站名称
 				return result;
 			}
 			function lunar_phase_list_refresh() {
@@ -923,20 +930,18 @@
 				g_coordinate_this.LT = position.coords.longitude; //经度
 				g_coordinate_this.height = position.coords.altitude; //海拔高度
 				//手动输入
-				var LT=Number($("#LT_°")[0].value);
-					LT+=Number($("#LT_’")[0].value)/60;
-					LT+=Number($("#LT_”")[0].value)/3600;
-					LT=Number($("#WE")[0].value+LT);
-				var AT=Number($("#AT_°")[0].value);
-					AT+=Number($("#AT_’")[0].value)/60;
-					AT+=Number($("#AT_”")[0].value)/3600;
-					AT=Number($("#NS")[0].value+AT);
-					if(AT!=0){
-						g_coordinate_this.LT=LT;
-						g_coordinate_this.AT=AT;
-
-					}
-
+				var LT = Number($("#LT_°")[0].value);
+				LT += Number($("#LT_’")[0].value) / 60;
+				LT += Number($("#LT_”")[0].value) / 3600;
+				LT = Number($("#WE")[0].value + LT);
+				var AT = Number($("#AT_°")[0].value);
+				AT += Number($("#AT_’")[0].value) / 60;
+				AT += Number($("#AT_”")[0].value) / 3600;
+				AT = Number($("#NS")[0].value + AT);
+				if (AT != 0) {
+					g_coordinate_this.LT = LT;
+					g_coordinate_this.AT = AT;
+				}
 
 				let position_string =
 					g_coordinate_this.AT + "#" + g_coordinate_this.LT + "#" + g_coordinate_this.height;
@@ -955,7 +960,6 @@
 				let height_string = g_coordinate_this.height + "M";
 				$("#selected_position_string").html(AT_string + " " + LT_string + " " + height_string);
 				$("#position_input").hide();
-
 			}
 			function showError(error) {
 				switch (error.code) {
@@ -989,7 +993,7 @@
 				}
 				return angle_str;
 			}
-			function input_position(){
+			function input_position() {
 				$("#position_input").show();
 			}
 		</script>

+ 0 - 0
app/lib/fullcalendar/examples/js/theme-chooser.js → app/calendar/js/theme-chooser.js


+ 0 - 0
app/lib/fullcalendar/examples/json/events.json → app/calendar/json/events.json


+ 0 - 0
app/lib/fullcalendar/examples/php/get-events.php → app/calendar/php/get-events.php


+ 0 - 0
app/lib/fullcalendar/examples/php/get-time-zones.php → app/calendar/php/get-time-zones.php


+ 0 - 0
app/lib/fullcalendar/examples/php/utils.php → app/calendar/php/utils.php


+ 1 - 74
app/course/course.php

@@ -13,80 +13,7 @@ include "../pcdl/html_head.php";
         height:100%;
     }
 </style>
-<link href='../lib/main.css' rel='stylesheet' />
-<script src='../lib/main.js'></script>
-<script>
-
-  document.addEventListener('DOMContentLoaded', function() {
-    var initialTimeZone = 'local';
-    var timeZoneSelectorEl = document.getElementById('time-zone-selector');
-    var loadingEl = document.getElementById('loading');
-    var calendarEl = document.getElementById('calendar');
-
-    var calendar = new FullCalendar.Calendar(calendarEl, {
-      timeZone: initialTimeZone,
-      headerToolbar: {
-        left: 'prev,next today',
-        center: 'title',
-        right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
-      },
-      initialDate: '2020-09-12',
-      navLinks: true, // can click day/week names to navigate views
-      editable: true,
-      selectable: true,
-      dayMaxEvents: true, // allow "more" link when too many events
-      events: {
-        url: 'php/get-events.php',
-        failure: function() {
-          document.getElementById('script-warning').style.display = 'inline'; // show
-        }
-      },
-      loading: function(bool) {
-        if (bool) {
-          loadingEl.style.display = 'inline'; // show
-        } else {
-          loadingEl.style.display = 'none'; // hide
-        }
-      },
-
-      eventTimeFormat: { hour: 'numeric', minute: '2-digit', timeZoneName: 'short' },
-
-      dateClick: function(arg) {
-        console.log('dateClick', calendar.formatIso(arg.date));
-      },
-      select: function(arg) {
-        console.log('select', calendar.formatIso(arg.start), calendar.formatIso(arg.end));
-      }
-    });
-
-    calendar.render();
-
-    // load the list of available timezones, build the <select> options
-    // it's HIGHLY recommended to use a different library for network requests, not this internal util func
-    FullCalendar.requestJson('GET', 'php/get-time-zones.php', {}, function(timeZones) {
-
-      timeZones.forEach(function(timeZone) {
-        var optionEl;
-
-        if (timeZone !== 'UTC') { // UTC is already in the list
-          optionEl = document.createElement('option');
-          optionEl.value = timeZone;
-          optionEl.innerText = timeZone;
-          timeZoneSelectorEl.appendChild(optionEl);
-        }
-      });
-    }, function() {
-      // TODO: handle error
-    });
-
-    // when the timezone selector changes, dynamically change the calendar option
-    timeZoneSelectorEl.addEventListener('change', function() {
-      calendar.setOption('timeZone', this.value);
-    });
-  });
-
-</script>
-
+    
 
 <?php
 //

+ 0 - 0
app/lib/fullcalendar/LICENSE.txt → app/fullcalendar/LICENSE.txt


+ 0 - 0
app/lib/fullcalendar/README.md → app/fullcalendar/README.md


+ 0 - 0
app/lib/fullcalendar/examples/background-events.html → app/fullcalendar/examples/background-events.html


+ 0 - 0
app/lib/fullcalendar/examples/daygrid-views.html → app/fullcalendar/examples/daygrid-views.html


+ 0 - 0
app/lib/fullcalendar/examples/external-dragging-2cals.html → app/fullcalendar/examples/external-dragging-2cals.html


+ 0 - 0
app/lib/fullcalendar/examples/external-dragging-builtin.html → app/fullcalendar/examples/external-dragging-builtin.html


+ 0 - 0
app/lib/fullcalendar/examples/full-height.html → app/fullcalendar/examples/full-height.html


+ 0 - 0
app/lib/fullcalendar/examples/google-calendar.html → app/fullcalendar/examples/google-calendar.html


+ 141 - 0
app/fullcalendar/examples/js/theme-chooser.js

@@ -0,0 +1,141 @@
+
+function initThemeChooser(settings) {
+  var isInitialized = false;
+  var currentThemeSystem; // don't set this directly. use setThemeSystem
+  var currentStylesheetEl;
+  var loadingEl = document.getElementById('loading');
+  var systemSelectEl = document.querySelector('#theme-system-selector select');
+  var themeSelectWrapEls = Array.prototype.slice.call( // convert to real array
+    document.querySelectorAll('.selector[data-theme-system]')
+  );
+
+  systemSelectEl.addEventListener('change', function() {
+    setThemeSystem(this.value);
+  });
+
+  setThemeSystem(systemSelectEl.value);
+
+  themeSelectWrapEls.forEach(function(themeSelectWrapEl) {
+    var themeSelectEl = themeSelectWrapEl.querySelector('select');
+
+    themeSelectWrapEl.addEventListener('change', function() {
+      setTheme(
+        currentThemeSystem,
+        themeSelectEl.options[themeSelectEl.selectedIndex].value
+      );
+    });
+  });
+
+
+  function setThemeSystem(themeSystem) {
+    var selectedTheme;
+
+    currentThemeSystem = themeSystem;
+
+    themeSelectWrapEls.forEach(function(themeSelectWrapEl) {
+      var themeSelectEl = themeSelectWrapEl.querySelector('select');
+
+      if (themeSelectWrapEl.getAttribute('data-theme-system') === themeSystem) {
+        selectedTheme = themeSelectEl.options[themeSelectEl.selectedIndex].value;
+        themeSelectWrapEl.style.display = 'inline-block';
+      } else {
+        themeSelectWrapEl.style.display = 'none';
+      }
+    });
+
+    setTheme(themeSystem, selectedTheme);
+  }
+
+
+  function setTheme(themeSystem, themeName) {
+    var stylesheetUrl = generateStylesheetUrl(themeSystem, themeName);
+    var stylesheetEl;
+
+    function done() {
+      if (!isInitialized) {
+        isInitialized = true;
+        settings.init(themeSystem);
+      }
+      else {
+        settings.change(themeSystem);
+      }
+
+      showCredits(themeSystem, themeName);
+    }
+
+    if (stylesheetUrl) {
+      stylesheetEl = document.createElement('link');
+      stylesheetEl.setAttribute('rel', 'stylesheet');
+      stylesheetEl.setAttribute('href', stylesheetUrl);
+      document.querySelector('head').appendChild(stylesheetEl);
+
+      loadingEl.style.display = 'inline';
+
+      whenStylesheetLoaded(stylesheetEl, function() {
+        if (currentStylesheetEl) {
+          currentStylesheetEl.parentNode.removeChild(currentStylesheetEl);
+        }
+        currentStylesheetEl = stylesheetEl;
+        loadingEl.style.display = 'none';
+        done();
+      });
+    } else {
+      if (currentStylesheetEl) {
+        currentStylesheetEl.parentNode.removeChild(currentStylesheetEl);
+        currentStylesheetEl = null
+      }
+      done();
+    }
+  }
+
+
+  function generateStylesheetUrl(themeSystem, themeName) {
+    if (themeSystem === 'bootstrap') {
+      if (themeName) {
+        return 'https://bootswatch.com/4/' + themeName + '/bootstrap.min.css';
+      }
+      else { // the default bootstrap theme
+        return 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css';
+      }
+    }
+  }
+
+
+  function showCredits(themeSystem, themeName) {
+    var creditId;
+
+    if (themeSystem.match('bootstrap')) {
+      if (themeName) {
+        creditId = 'bootstrap-custom';
+      }
+      else {
+        creditId = 'bootstrap-standard';
+      }
+    }
+
+    Array.prototype.slice.call( // convert to real array
+      document.querySelectorAll('.credits')
+    ).forEach(function(creditEl) {
+      if (creditEl.getAttribute('data-credit-id') === creditId) {
+        creditEl.style.display = 'block';
+      } else {
+        creditEl.style.display = 'none';
+      }
+    })
+  }
+
+
+  function whenStylesheetLoaded(linkNode, callback) {
+    var isReady = false;
+
+    function ready() {
+      if (!isReady) { // avoid double-call
+        isReady = true;
+        callback();
+      }
+    }
+
+    linkNode.onload = ready; // does not work cross-browser
+    setTimeout(ready, 2000); // max wait. also handles browsers that don't support onload
+  }
+}

+ 0 - 0
app/lib/fullcalendar/examples/json.html → app/fullcalendar/examples/json.html


+ 228 - 0
app/fullcalendar/examples/json/events.json

@@ -0,0 +1,228 @@
+[
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-11-30T08:00:00+06:30",
+		"end": "2020-11-30T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-1T08:00:00+06:30",
+		"end": "2020-12-1T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-4T08:00:00+06:30",
+		"end": "2020-12-4T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-7T08:00:00+06:30",
+		"end": "2020-12-7T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-8T08:00:00+06:30",
+		"end": "2020-12-8T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-11T08:00:00+06:30",
+		"end": "2020-12-11T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-14T08:00:00+06:30",
+		"end": "2020-12-14T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-15T08:00:00+06:30",
+		"end": "2020-12-15T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-18T08:00:00+06:30",
+		"end": "2020-12-18T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-21T08:00:00+06:30",
+		"end": "2020-12-21T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-22T08:00:00+06:30",
+		"end": "2020-12-22T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-25T08:00:00+06:30",
+		"end": "2020-12-25T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-28T08:00:00+06:30",
+		"end": "2020-12-28T09:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2020-12-29T08:00:00+06:30",
+		"end": "2020-12-29T09:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2020-12-3T7:00:00+06:30",
+		"end": "2020-12-3T8:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2020-12-10T7:00:00+06:30",
+		"end": "2020-12-10T8:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2020-12-17T7:00:00+06:30",
+		"end": "2020-12-17T8:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2020-12-24T7:00:00+06:30",
+		"end": "2020-12-24T8:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2020-12-31T7:00:00+06:30",
+		"end": "2020-12-31T8:30:00+06:30"
+	},
+	{
+		"id": "888",
+		"title": "kāmasuttaniddesa",
+		"url": "https://www.wikipali.org/app/course/course.php?id=7f18a3b9-0cd5-47f6-99dd-bae441227d27",
+		"start": "2021-1-7T7:00:00+06:30",
+		"end": "2021-1-7T8:30:00+06:30"
+	},
+	{
+		"id": "999",
+		"title": "Dhammacakkha",
+		"url": "https://www.wikipali.org/app/course/lesson.php?id=6a42e993-8f7e-414a-a291-a4094764f992",
+		"start": "2021-1-1T08:00:00+06:30",
+		"end": "2021-1-1T09:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-07T2:30:00-05:00",
+		"end": "2020-12-07T4:00:00-05:00"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-10T2:30:00-05:00",
+		"end": "2020-12-10T4:00:00-05:00"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-11T2:30:00-05:00",
+		"end": "2020-12-11T4:00:00-05:00"
+	},
+	{
+		"id": "1001",
+		"title": "haritaca-jātaka",
+		"url": "https://youtu.be/5UdZDewA3TA",
+		"start": "2020-12-13T19:00:00+07:00",
+		"end": "2020-12-13T21:00:00+07:00"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-16T14:00:00+06:30",
+		"end": "2020-12-16T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-17T14:00:00+06:30",
+		"end": "2020-12-17T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-18T14:00:00+06:30",
+		"end": "2020-12-18T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-21T14:00:00+06:30",
+		"end": "2020-12-21T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-24T14:00:00+06:30",
+		"end": "2020-12-24T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-25T14:00:00+06:30",
+		"end": "2020-12-25T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-28T14:00:00+06:30",
+		"end": "2020-12-28T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2020-12-30T14:00:00+06:30",
+		"end": "2020-12-30T15:30:00+06:30"
+	},
+	{
+		"id": "1000",
+		"title": "nibbāna-gāmini",
+		"start": "2021-01-01T14:00:00+06:30",
+		"end": "2021-01-01T15:30:00+06:30"
+	}
+]

+ 0 - 0
app/lib/fullcalendar/examples/list-sticky-header.html → app/fullcalendar/examples/list-sticky-header.html


+ 0 - 0
app/lib/fullcalendar/examples/list-views.html → app/fullcalendar/examples/list-views.html


+ 0 - 0
app/lib/fullcalendar/examples/locales.html → app/fullcalendar/examples/locales.html


+ 0 - 0
app/lib/fullcalendar/examples/month-view.html → app/fullcalendar/examples/month-view.html


+ 0 - 0
app/lib/fullcalendar/examples/natural-height.html → app/fullcalendar/examples/natural-height.html


+ 0 - 0
app/lib/fullcalendar/examples/php/get_date.php → app/fullcalendar/examples/php/get-date.php


+ 50 - 0
app/fullcalendar/examples/php/get-events.php

@@ -0,0 +1,50 @@
+<?php
+
+//--------------------------------------------------------------------------------------------------
+// This script reads event data from a JSON file and outputs those events which are within the range
+// supplied by the "start" and "end" GET parameters.
+//
+// An optional "timeZone" GET parameter will force all ISO8601 date stings to a given timeZone.
+//
+// Requires PHP 5.2.0 or higher.
+//--------------------------------------------------------------------------------------------------
+
+// Require our Event class and datetime utilities
+require dirname(__FILE__) . '/utils.php';
+
+// Short-circuit if the client did not give us a date range.
+if (!isset($_GET['start']) || !isset($_GET['end'])) {
+  die("Please provide a date range.");
+}
+
+// Parse the start/end parameters.
+// These are assumed to be ISO8601 strings with no time nor timeZone, like "2013-12-29".
+// Since no timeZone will be present, they will parsed as UTC.
+$range_start = parseDateTime($_GET['start']);
+$range_end = parseDateTime($_GET['end']);
+
+// Parse the timeZone parameter if it is present.
+$time_zone = null;
+if (isset($_GET['timeZone'])) {
+  $time_zone = new DateTimeZone($_GET['timeZone']);
+}
+
+// Read and parse our events JSON file into an array of event data arrays.
+$json = file_get_contents(dirname(__FILE__) . '/../json/events.json');
+$input_arrays = json_decode($json, true);
+
+// Accumulate an output array of event data arrays.
+$output_arrays = array();
+foreach ($input_arrays as $array) {
+
+  // Convert the input array into a useful Event object
+  $event = new Event($array, $time_zone);
+
+  // If the event is in-bounds, add it to the output
+  if ($event->isWithinDayRange($range_start, $range_end)) {
+    $output_arrays[] = $event->toArray();
+  }
+}
+
+// Send JSON to the client.
+echo json_encode($output_arrays);

+ 9 - 0
app/fullcalendar/examples/php/get-time-zones.php

@@ -0,0 +1,9 @@
+<?php
+
+//--------------------------------------------------------------------------------------------------
+// This script outputs a JSON array of all timezones (like "America/Chicago") that PHP supports.
+//
+// Requires PHP 5.2.0 or higher.
+//--------------------------------------------------------------------------------------------------
+
+echo json_encode(DateTimeZone::listIdentifiers());

+ 130 - 0
app/fullcalendar/examples/php/utils.php

@@ -0,0 +1,130 @@
+<?php
+
+//--------------------------------------------------------------------------------------------------
+// Utilities for our event-fetching scripts.
+//
+// Requires PHP 5.2.0 or higher.
+//--------------------------------------------------------------------------------------------------
+
+// PHP will fatal error if we attempt to use the DateTime class without this being set.
+date_default_timezone_set('UTC');
+
+
+class Event {
+
+  // Tests whether the given ISO8601 string has a time-of-day or not
+  const ALL_DAY_REGEX = '/^\d{4}-\d\d-\d\d$/'; // matches strings like "2013-12-29"
+
+  public $title;
+  public $allDay; // a boolean
+  public $start; // a DateTime
+  public $end; // a DateTime, or null
+  public $properties = array(); // an array of other misc properties
+
+
+  // Constructs an Event object from the given array of key=>values.
+  // You can optionally force the timeZone of the parsed dates.
+  public function __construct($array, $timeZone=null) {
+
+    $this->title = $array['title'];
+
+    if (isset($array['allDay'])) {
+      // allDay has been explicitly specified
+      $this->allDay = (bool)$array['allDay'];
+    }
+    else {
+      // Guess allDay based off of ISO8601 date strings
+      $this->allDay = preg_match(self::ALL_DAY_REGEX, $array['start']) &&
+        (!isset($array['end']) || preg_match(self::ALL_DAY_REGEX, $array['end']));
+    }
+
+    if ($this->allDay) {
+      // If dates are allDay, we want to parse them in UTC to avoid DST issues.
+      $timeZone = null;
+    }
+
+    // Parse dates
+    $this->start = parseDateTime($array['start'], $timeZone);
+    $this->end = isset($array['end']) ? parseDateTime($array['end'], $timeZone) : null;
+
+    // Record misc properties
+    foreach ($array as $name => $value) {
+      if (!in_array($name, array('title', 'allDay', 'start', 'end'))) {
+        $this->properties[$name] = $value;
+      }
+    }
+  }
+
+
+  // Returns whether the date range of our event intersects with the given all-day range.
+  // $rangeStart and $rangeEnd are assumed to be dates in UTC with 00:00:00 time.
+  public function isWithinDayRange($rangeStart, $rangeEnd) {
+
+    // Normalize our event's dates for comparison with the all-day range.
+    $eventStart = stripTime($this->start);
+
+    if (isset($this->end)) {
+      $eventEnd = stripTime($this->end); // normalize
+    }
+    else {
+      $eventEnd = $eventStart; // consider this a zero-duration event
+    }
+
+    // Check if the two whole-day ranges intersect.
+    return $eventStart < $rangeEnd && $eventEnd >= $rangeStart;
+  }
+
+
+  // Converts this Event object back to a plain data array, to be used for generating JSON
+  public function toArray() {
+
+    // Start with the misc properties (don't worry, PHP won't affect the original array)
+    $array = $this->properties;
+
+    $array['title'] = $this->title;
+
+    // Figure out the date format. This essentially encodes allDay into the date string.
+    if ($this->allDay) {
+      $format = 'Y-m-d'; // output like "2013-12-29"
+    }
+    else {
+      $format = 'c'; // full ISO8601 output, like "2013-12-29T09:00:00+08:00"
+    }
+
+    // Serialize dates into strings
+    $array['start'] = $this->start->format($format);
+    if (isset($this->end)) {
+      $array['end'] = $this->end->format($format);
+    }
+
+    return $array;
+  }
+
+}
+
+
+// Date Utilities
+//----------------------------------------------------------------------------------------------
+
+
+// Parses a string into a DateTime object, optionally forced into the given timeZone.
+function parseDateTime($string, $timeZone=null) {
+  $date = new DateTime(
+    $string,
+    $timeZone ? $timeZone : new DateTimeZone('UTC')
+      // Used only when the string is ambiguous.
+      // Ignored if string has a timeZone offset in it.
+  );
+  if ($timeZone) {
+    // If our timeZone was ignored above, force it.
+    $date->setTimezone($timeZone);
+  }
+  return $date;
+}
+
+
+// Takes the year/month/date values of the given DateTime and converts them to a new DateTime,
+// but in UTC.
+function stripTime($datetime) {
+  return new DateTime($datetime->format('Y-m-d'));
+}

+ 0 - 0
app/lib/fullcalendar/examples/selectable.html → app/fullcalendar/examples/selectable.html


+ 0 - 0
app/lib/fullcalendar/examples/theming.html → app/fullcalendar/examples/theming.html


+ 21 - 12
app/lib/fullcalendar/examples/time-zones.php → app/fullcalendar/examples/time-zones.php

@@ -31,25 +31,17 @@
 						center: "title",
 						right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek",
 					},
-					//initialDate: "2020-12-12",
+					//initialDate: '2020-09-12',
 					navLinks: true, // can click day/week names to navigate views
 					editable: true,
 					selectable: true,
 					dayMaxEvents: true, // allow "more" link when too many events
 					events: {
-						url: "php/get_date.php?teacher=<?php echo $_GET["teacher"]?>",
+						url: "php/get-events.php",
 						failure: function () {
 							document.getElementById("script-warning").style.display = "inline"; // show
 						},
 					},
-					eventClick: function (info) {
-						info.jsEvent.preventDefault(); // don't let the browser navigate
-
-						if (info.event.url) {
-							window.open(info.event.url);
-						}
-					},
-
 					loading: function (bool) {
 						if (bool) {
 							loadingEl.style.display = "inline"; // show
@@ -57,8 +49,15 @@
 							loadingEl.style.display = "none"; // hide
 						}
 					},
+					eventClick: function (info) {
+						info.jsEvent.preventDefault(); // don't let the browser navigate
+
+						if (info.event.url) {
+							window.open(info.event.url);
+						}
+					},
 
-					eventTimeFormat: { hour: "numeric", minute: "2-digit" },
+					eventTimeFormat: { hour: "numeric", minute: "2-digit" }, //timeZoneName: "short"
 
 					dateClick: function (arg) {
 						console.log("dateClick", calendar.formatIso(arg.date));
@@ -117,6 +116,7 @@
 			}
 			.left {
 				float: left;
+				font-size: 150%;
 			}
 			.right {
 				float: right;
@@ -143,12 +143,21 @@
 			.tzo {
 				color: #000;
 			}
+			#time-zone-selector{
+				font-size: 100%;
+			}		
+.fc-direction-ltr .fc-daygrid-event.fc-event-end, .fc-direction-rtl .fc-daygrid-event.fc-event-start {
+    flex-flow: wrap;
+}
+.fc-event-title{
+	margin-left: 16px;
+}
 		</style>
 	</head>
 	<body>
 		<div id="top">
 			<div class="left">
-				Timezone:
+			Timezone:
 				<select id="time-zone-selector">
 					<option value="local" selected>local</option>
 					<option value="UTC">UTC</option>

+ 173 - 0
app/fullcalendar/examples/time-zones1.php

@@ -0,0 +1,173 @@
+<?php 
+
+include "../../ucenter/user.php";
+include "../../lang/lang.php";			
+?>
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="utf-8" />
+		<link href="../lib/main.css" rel="stylesheet" />
+		<script src="../lib/main.js"></script>
+		<script>
+			function getCookie(name) {
+				var start = document.cookie.indexOf(name + "=");
+				var len = start + name.length + 1;
+				if (!start && name != document.cookie.substring(0, name.length)) {
+					return null;
+				}
+				if (start == -1) return null;
+				var end = document.cookie.indexOf(";", len);
+				if (end == -1) end = document.cookie.length;
+				return decodeURI(document.cookie.substring(len, end));
+			}
+
+			document.addEventListener("DOMContentLoaded", function () {
+				var initialTimeZone = "local";
+				var timeZoneSelectorEl = document.getElementById("time-zone-selector");
+				var loadingEl = document.getElementById("loading");
+				var calendarEl = document.getElementById("calendar");
+
+				var calendar = new FullCalendar.Calendar(calendarEl, {
+					timeZone: initialTimeZone,
+					locale: getCookie("language"),
+					headerToolbar: {
+						left: "prev,next today",
+						center: "title",
+						right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek",
+					},
+					//initialDate: "2020-12-12",
+					navLinks: true, // can click day/week names to navigate views
+					editable: true,
+					selectable: true,
+					dayMaxEvents: true, // allow "more" link when too many events
+					events: {
+						url: "php/get_events.php",
+						failure: function () {
+							document.getElementById("script-warning").style.display = "inline"; // show
+						},
+					},
+					eventClick: function (info) {
+						info.jsEvent.preventDefault(); // don't let the browser navigate
+
+						if (info.event.url) {
+							window.open(info.event.url);
+						}
+					},
+
+					loading: function (bool) {
+						if (bool) {
+							loadingEl.style.display = "inline"; // show
+						} else {
+							loadingEl.style.display = "none"; // hide
+						}
+					},
+
+					eventTimeFormat: { hour: "numeric", minute: "2-digit" },
+
+					dateClick: function (arg) {
+						console.log("dateClick", calendar.formatIso(arg.date));
+					},
+					select: function (arg) {
+						console.log("select", calendar.formatIso(arg.start), calendar.formatIso(arg.end));
+					},
+				});
+
+				calendar.render();
+
+				// load the list of available timezones, build the <select> options
+				// it's HIGHLY recommended to use a different library for network requests, not this internal util func
+				FullCalendar.requestJson(
+					"GET",
+					"php/get-time-zones.php",
+					{},
+					function (timeZones) {
+						timeZones.forEach(function (timeZone) {
+							var optionEl;
+
+							if (timeZone !== "UTC") {
+								// UTC is already in the list
+								optionEl = document.createElement("option");
+								optionEl.value = timeZone;
+								optionEl.innerText = timeZone;
+								timeZoneSelectorEl.appendChild(optionEl);
+							}
+						});
+					},
+					function () {
+						// TODO: handle error
+					}
+				);
+
+				// when the timezone selector changes, dynamically change the calendar option
+				timeZoneSelectorEl.addEventListener("change", function () {
+					calendar.setOption("timeZone", this.value);
+				});
+			});
+		</script>
+		<style>
+			body {
+				margin: 0;
+				padding: 0;
+				font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
+				font-size: 14px;
+			}
+
+			#top {
+				background: #eee;
+				border-bottom: 1px solid #ddd;
+				padding: 0 10px;
+				line-height: 40px;
+				font-size: 12px;
+			}
+			.left {
+				float: left;
+			}
+			.right {
+				float: right;
+			}
+			.clear {
+				clear: both;
+			}
+
+			#script-warning,
+			#loading {
+				display: none;
+			}
+			#script-warning {
+				font-weight: bold;
+				color: red;
+			}
+
+			#calendar {
+				max-width: 1100px;
+				margin: 40px auto;
+				padding: 0 10px;
+			}
+
+			.tzo {
+				color: #000;
+			}
+		</style>
+	</head>
+	<body>
+		<div id="top">
+			<div class="left">
+			<?php echo $_local->gui->timezone; ?>:
+				<select id="time-zone-selector">
+					<option value="local" selected>local</option>
+					<option value="UTC">UTC</option>
+				</select>
+			</div>
+
+			<div class="right">
+				<span id="loading">loading...</span>
+				<span id="script-warning"><code>php/get-events.php</code> must be running.</span>
+			</div>
+
+			<div class="clear"></div>
+		</div>
+
+		<div id="calendar"></div>
+	</body>
+</html>

+ 0 - 0
app/lib/fullcalendar/examples/timegrid-sticky-header.html → app/fullcalendar/examples/timegrid-sticky-header.html


+ 0 - 0
app/lib/fullcalendar/examples/timegrid-views-hscroll.html → app/fullcalendar/examples/timegrid-views-hscroll.html


+ 0 - 0
app/lib/fullcalendar/examples/timegrid-views.html → app/fullcalendar/examples/timegrid-views.html


+ 0 - 0
app/lib/fullcalendar/examples/week-numbers.html → app/fullcalendar/examples/week-numbers.html


+ 0 - 0
app/lib/fullcalendar/lib/locales-all.js → app/fullcalendar/lib/locales-all.js


+ 0 - 0
app/lib/fullcalendar/lib/locales-all.min.js → app/fullcalendar/lib/locales-all.min.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/af.js → app/fullcalendar/lib/locales/af.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-dz.js → app/fullcalendar/lib/locales/ar-dz.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-kw.js → app/fullcalendar/lib/locales/ar-kw.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-ly.js → app/fullcalendar/lib/locales/ar-ly.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-ma.js → app/fullcalendar/lib/locales/ar-ma.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-sa.js → app/fullcalendar/lib/locales/ar-sa.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar-tn.js → app/fullcalendar/lib/locales/ar-tn.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ar.js → app/fullcalendar/lib/locales/ar.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/az.js → app/fullcalendar/lib/locales/az.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/bg.js → app/fullcalendar/lib/locales/bg.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/bs.js → app/fullcalendar/lib/locales/bs.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ca.js → app/fullcalendar/lib/locales/ca.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/cs.js → app/fullcalendar/lib/locales/cs.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/da.js → app/fullcalendar/lib/locales/da.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/de.js → app/fullcalendar/lib/locales/de.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/el.js → app/fullcalendar/lib/locales/el.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/en-au.js → app/fullcalendar/lib/locales/en-au.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/en-gb.js → app/fullcalendar/lib/locales/en-gb.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/en-nz.js → app/fullcalendar/lib/locales/en-nz.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/es-us.js → app/fullcalendar/lib/locales/es-us.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/es.js → app/fullcalendar/lib/locales/es.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/et.js → app/fullcalendar/lib/locales/et.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/eu.js → app/fullcalendar/lib/locales/eu.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/fa.js → app/fullcalendar/lib/locales/fa.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/fi.js → app/fullcalendar/lib/locales/fi.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/fr-ca.js → app/fullcalendar/lib/locales/fr-ca.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/fr-ch.js → app/fullcalendar/lib/locales/fr-ch.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/fr.js → app/fullcalendar/lib/locales/fr.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/gl.js → app/fullcalendar/lib/locales/gl.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/he.js → app/fullcalendar/lib/locales/he.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/hi.js → app/fullcalendar/lib/locales/hi.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/hr.js → app/fullcalendar/lib/locales/hr.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/hu.js → app/fullcalendar/lib/locales/hu.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/id.js → app/fullcalendar/lib/locales/id.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/is.js → app/fullcalendar/lib/locales/is.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/it.js → app/fullcalendar/lib/locales/it.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ja.js → app/fullcalendar/lib/locales/ja.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ka.js → app/fullcalendar/lib/locales/ka.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/kk.js → app/fullcalendar/lib/locales/kk.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ko.js → app/fullcalendar/lib/locales/ko.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/lb.js → app/fullcalendar/lib/locales/lb.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/lt.js → app/fullcalendar/lib/locales/lt.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/lv.js → app/fullcalendar/lib/locales/lv.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/mk.js → app/fullcalendar/lib/locales/mk.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ms.js → app/fullcalendar/lib/locales/ms.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/nb.js → app/fullcalendar/lib/locales/nb.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ne.js → app/fullcalendar/lib/locales/ne.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/nl.js → app/fullcalendar/lib/locales/nl.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/nn.js → app/fullcalendar/lib/locales/nn.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/pl.js → app/fullcalendar/lib/locales/pl.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/pt-br.js → app/fullcalendar/lib/locales/pt-br.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/pt.js → app/fullcalendar/lib/locales/pt.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ro.js → app/fullcalendar/lib/locales/ro.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/ru.js → app/fullcalendar/lib/locales/ru.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sk.js → app/fullcalendar/lib/locales/sk.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sl.js → app/fullcalendar/lib/locales/sl.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sq.js → app/fullcalendar/lib/locales/sq.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sr-cyrl.js → app/fullcalendar/lib/locales/sr-cyrl.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sr.js → app/fullcalendar/lib/locales/sr.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/sv.js → app/fullcalendar/lib/locales/sv.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/th.js → app/fullcalendar/lib/locales/th.js


+ 0 - 0
app/lib/fullcalendar/lib/locales/tr.js → app/fullcalendar/lib/locales/tr.js


Некоторые файлы не были показаны из-за большого количества измененных файлов