Fix: complete extending maestro

This commit is contained in:
2019-10-31 14:32:25 +09:00
parent d60f6a7ad0
commit cb64f98c64
5 changed files with 79 additions and 39 deletions
+20 -6
View File
@@ -21,12 +21,26 @@ MaestroAvailableDate.prototype.getDiffDay = function() {
return Math.ceil(diffDay);
}
MaestroAvailableDate.prototype.getNewAvailableDate = function(diffDay) {
MaestroAvailableDate.prototype.isExpiredMaestro = function() {
if(this.getDiffDay() < 0)
return true;
return false;
}
MaestroAvailableDate.prototype.getAvailableDate = function() {
return this.endDate;
}
MaestroAvailableDate.prototype.getNewAvailableDate = function() {
var diffDay = this.getDiffDay();
var newDate = null;
if(diffDay < 0) // end date is over
if(diffDay < 0) // end date is over
newDate = new Date(new Date().setFullYear(this.today.getFullYear() + 1));
else
newDate = new Date(new Date().setFullYear(this.endDay.getFullYear() + 1));
newDate = new Date(new Date(this.endDate).setFullYear(this.endDay.getFullYear() + 1));
// console.log("# newDate : " + newDate);
var year2Digits = newDate.getFullYear();
var month2Digits = ("0"+(newDate.getMonth()+1)).slice(-2);
@@ -45,7 +59,7 @@ MaestroAvailableDate.prototype.showMaestroExtensionMessage = function(maestroNam
var message = "";
if(diffDay > 0)
message = "<span class='font-weight-bold'>" + maestroName + "</span> 계정의 유효기간이 얼마 남지 않았습니다.<br/>1년 더 사용 원하신다면 우측의 [유효기간 연장] 버튼을 눌러주세요.";
message = "<span class='font-weight-bold'>" + maestroName + "</span> 계정의 유효기간이 얼마 남지 않았습니다.<br/>1년 더 사용하기를 원하신다면 우측의 [유효기간 연장] 버튼을 눌러주세요.";
else
message = "<span class='font-weight-bold'>" + maestroName + "</span> 계정의 유효기간이 지났습니다. 등록된 학생들의 정보는 유지되지만, 로그인이 제한됩니다.<br/>유효기간 연장을 하시면 다시 로그인하고 사용할 수 있게 됩니다.";
@@ -61,12 +75,12 @@ MaestroAvailableDate.prototype.showEndDate = function() {
$("#end_day").html(this.endDate);
if(diffDay < 0) {
$("#maestro_count_down_date").html("유효 기간 : ~ " + this.endDate + " <span id='countdown_day'>(" + Math.abs(diffDay) + "일 경과) </span>");
$("#maestro_count_down_date").html("유효기간 : ~ " + this.endDate + " <span id='countdown_day'>(" + Math.abs(diffDay) + "일 경과) </span>");
$("#countdown_day").addClass("bg-danger font-weight-bold text-light");
}
else {
$("#maestro_count_down_date").html("유효 기간 : ~ " + this.endDate + " <span id='countdown_day'>(남은 기간 : " + diffDay + "일)</span>");
$("#maestro_count_down_date").html("유효기간 : ~ " + this.endDate + " <span id='countdown_day'>(남은 기간 : " + diffDay + "일)</span>");
if(diffDay < 10)
$("#countdown_day").addClass("bg-danger text-light");