diff --git a/src/web/js/lib/maestro_info.js b/src/web/js/lib/maestro_info.js
index c85a8c8..0fe9905 100644
--- a/src/web/js/lib/maestro_info.js
+++ b/src/web/js/lib/maestro_info.js
@@ -2,6 +2,7 @@ function MaestroInfo() {
this.maestroID = sessionStorage.getItem("maestroID");
this.maestroName = "";
this.accountType = 0;
+ this.availableActivateDateTime = "";
this.playerCount = 0;
}
@@ -15,6 +16,7 @@ MaestroInfo.prototype.loadMaestroInfo = function(onSuccess, onFail) {
function(jsonData) {
self.maestroName = jsonData["name"];
self.accountType = jsonData["accountType"];
+ self.availableActivateDateTime = jsonData["availableActivateDateTime"];
self.playerCount = jsonData["playerCount"];
onSuccess();
diff --git a/src/web/module/maestro_section_main.html b/src/web/module/maestro_section_main.html
index 3ae89a3..fadee13 100644
--- a/src/web/module/maestro_section_main.html
+++ b/src/web/module/maestro_section_main.html
@@ -22,9 +22,26 @@ function isExperienceMaestroAccount() {
return false;
}
+function showEndDate(date) {
+ var endDateArray = date.split(" ");
+ var endDate = endDateArray[0]; // "YY-MM_DD"
+
+ var today = new Date();
+ var endDay = new Date(endDate);
+ var diffDay = (endDay.getTime() - today.getTime()) / (1000 * 60 * 60 * 24);
+
+ $("#maestro_count_down_date").html("~ " + endDate + "
유효 기간 : " + Math.ceil(diffDay) + "일");
+ if(diffDay < 30)
+ $("#maestro_count_down_date").addClass("text-danger");
+ else if(diffDay < 10)
+ $("#maestro_count_down_date").addClass("bg-danger text-light");
+ else if(diffDay < 0)
+ $("#maestro_count_down_date").addClass("bg-secondary text-light");
+}
function onLoadSuccessMaestroInfo() {
- $("#maestro_info_id").text(maestroInfo.maestroName + "님, 환영합니다.");
+ $("#maestro_info_id").text("[ " + maestroInfo.maestroName + " ] 님, 환영합니다.");
+ showEndDate(maestroInfo.availableActivateDateTime);
$("#maestro_info_player_count").val("학생수 : " + maestroInfo.getRegisteredPlayerCount() + " / " + maestroInfo.getMaxPlayerCount());
if(maestroInfo.getRegisteredPlayerCount() === maestroInfo.getMaxPlayerCount()) {
@@ -120,8 +137,9 @@ function deactivateApp(appID) {