andre 4 년 전
부모
커밋
f533b88eab
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      js/scripts.js

+ 9 - 4
js/scripts.js

@@ -3820,12 +3820,16 @@ function updateProductTotalMessage(billingcycle) {
     switch(billingcycle) {
         case 'monthly':
             console.log(billingcycle);
-            days = daysIntoYear(new Date(now.getFullYear(), now.getMonth() + 1, 0)) - daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
-            console.log(days);
+            billingDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth() + 1, 0));
+            orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
+            console.log(billingDay - orderDay);
             jQuery('#producttotalmessage').html('Monatlich');
             break;
         case 'quarterly':
             console.log(billingcycle);
+            if (now.getMonth() < 4) {
+                console.log("1st quarter");
+            }
             jQuery('#producttotalmessage').html('4teljährlich');
             break;
         case 'semiannually':
@@ -3834,8 +3838,9 @@ function updateProductTotalMessage(billingcycle) {
             break;
         case 'annually':
             console.log(billingcycle);
-            days = daysIntoYear(new Date(now.getFullYear(), 11, 31)) - daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
-            console.log(days);
+            billingDay = daysIntoYear(new Date(now.getFullYear(), 11, 31));
+            orderDay = daysIntoYear(new Date(now.getFullYear(), now.getMonth(), now.getDate()));
+            console.log(billingDay - orderDay);
             jQuery('#producttotalmessage').html('Jährlich');
             break;
     }