Bhikkhu-Kosalla 5 лет назад
Родитель
Сommit
55e80f424d

+ 21 - 17
app/fullcalendar/examples/time-zones.php

@@ -1,8 +1,3 @@
-<?php 
-
-include "../ucenter/user.php";
-include "../../../lang/lang.php";			
-?>
 <!DOCTYPE html>
 <html>
 	<head>
@@ -36,25 +31,17 @@ include "../../../lang/lang.php";
 						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_events.php",
+						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
@@ -62,8 +49,15 @@ include "../../../lang/lang.php";
 							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));
@@ -122,6 +116,7 @@ include "../../../lang/lang.php";
 			}
 			.left {
 				float: left;
+				font-size: 150%;
 			}
 			.right {
 				float: right;
@@ -148,12 +143,21 @@ include "../../../lang/lang.php";
 			.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>

+ 17 - 11
app/fullcalendar/examples/time-zones.html → app/fullcalendar/examples/time-zones1.php

@@ -1,3 +1,8 @@
+<?php 
+
+include "../../ucenter/user.php";
+include "../../lang/lang.php";			
+?>
 <!DOCTYPE html>
 <html>
 	<head>
@@ -31,24 +36,17 @@
 						center: "title",
 						right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek",
 					},
-					//initialDate: '2020-09-12',
+					//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",
+						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
-						}
-					},
 					eventClick: function (info) {
 						info.jsEvent.preventDefault(); // don't let the browser navigate
 
@@ -57,7 +55,15 @@
 						}
 					},
 
-					eventTimeFormat: { hour: "numeric", minute: "2-digit" }, //timeZoneName: "short"
+					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));
@@ -147,7 +153,7 @@
 	<body>
 		<div id="top">
 			<div class="left">
-				Timezone:
+			<?php echo $_local->gui->timezone; ?>:
 				<select id="time-zone-selector">
 					<option value="local" selected>local</option>
 					<option value="UTC">UTC</option>

+ 29 - 28
app/fullcalendar/lib/locales/zh-cn.js

@@ -1,30 +1,31 @@
-FullCalendar.globalLocales.push(function () {
-  'use strict';
+FullCalendar.globalLocales.push(
+	(function () {
+		"use strict";
 
-  var zhCn = {
-    code: 'zh-cn',
-    week: {
-      // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
-      dow: 1, // Monday is the first day of the week.
-      doy: 4, // The week that contains Jan 4th is the first week of the year.
-    },
-    buttonText: {
-      prev: '上月',
-      next: '下月',
-      today: '今天',
-      month: '月',
-      week: '周',
-      day: '日',
-      list: '日程',
-    },
-    weekText: '周',
-    allDayText: '全天',
-    moreLinkText(n) {
-      return '另外 ' + n + ' 个'
-    },
-    noEventsText: '没有事件显示',
-  };
+		var zhCn = {
+			code: "zh-cn",
+			week: {
+				// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
+				dow: 1, // Monday is the first day of the week.
+				doy: 4, // The week that contains Jan 4th is the first week of the year.
+			},
+			buttonText: {
+				prev: "上月",
+				next: "下月",
+				today: "今天",
+				month: "月",
+				week: "周",
+				day: "日",
+				list: "日程",
+			},
+			weekText: "周",
+			allDayText: "全天",
+			moreLinkText(n) {
+				return "另外 " + n + " 个";
+			},
+			noEventsText: "没有事件显示",
+		};
 
-  return zhCn;
-
-}());
+		return zhCn;
+	})()
+);

+ 1 - 0
app/public/lang/default.json

@@ -560,6 +560,7 @@
 		"top_search": "Top search",
 		"similar_sentences": "similar sentences",
 		"close": "close",
+		"timezone": "Timezone",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 0
app/public/lang/en.json

@@ -559,6 +559,7 @@
 		"top_search": "Top search",
 		"similar_sentences": "similar sentences",
 		"close": "close",
+		"timezone": "Timezone",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 0
app/public/lang/my.json

@@ -559,6 +559,7 @@
 		"top_search": "Top search",
 		"similar_sentences": "similar sentences",
 		"close": "close",
+		"timezone": "Timezone",
 		"": "",
 		"": ""
 	},

+ 1 - 0
app/public/lang/si.json

@@ -564,6 +564,7 @@
 		"top_search": "Top search",
 		"similar_sentences": "similar sentences",
 		"close": "close",
+		"timezone": "Timezone",
 		"": "",
 		"": ""
 	},

+ 1 - 0
app/public/lang/zh-cn.json

@@ -561,6 +561,7 @@
 		"top_search": "热搜",
 		"similar_sentences": "相似句",
 		"close": "关闭",
+		"timezone": "时区",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 0
app/public/lang/zh-tw.json

@@ -561,6 +561,7 @@
 		"top_search": "熱搜",
 		"similar_sentences": "相似句",
 		"close": "關閉",
+		"timezone": "時區",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 1
app/uhome/course.php

@@ -24,7 +24,7 @@ include "../pcdl/html_head.php";
     },
     function(data,status){
         let arrData = JSON.parse(data);
-        let html='<iframe style="width: 100%;height: 67em;" src="../fullcalendar/examples/time-zones.html"></iframe>';
+        let html='<iframe style="width: 100%;height: 67em;" src="../fullcalendar/examples/time-zones.php"></iframe>';
         for (const iterator of arrData) {
             html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';