andre 4 жил өмнө
parent
commit
f533b88eab
1 өөрчлөгдсөн 9 нэмэгдсэн , 4 устгасан
  1. 9 4
      js/scripts.js

+ 9 - 4
js/scripts.js

@@ -3820,12 +3820,16 @@ function updateProductTotalMessage(billingcycle) {
     switch(billingcycle) {
     switch(billingcycle) {
         case 'monthly':
         case 'monthly':
             console.log(billingcycle);
             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');
             jQuery('#producttotalmessage').html('Monatlich');
             break;
             break;
         case 'quarterly':
         case 'quarterly':
             console.log(billingcycle);
             console.log(billingcycle);
+            if (now.getMonth() < 4) {
+                console.log("1st quarter");
+            }
             jQuery('#producttotalmessage').html('4teljährlich');
             jQuery('#producttotalmessage').html('4teljährlich');
             break;
             break;
         case 'semiannually':
         case 'semiannually':
@@ -3834,8 +3838,9 @@ function updateProductTotalMessage(billingcycle) {
             break;
             break;
         case 'annually':
         case 'annually':
             console.log(billingcycle);
             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');
             jQuery('#producttotalmessage').html('Jährlich');
             break;
             break;
     }
     }