andre 4 anni fa
parent
commit
2adabb6d0f
1 ha cambiato i file con 10 aggiunte e 4 eliminazioni
  1. 10 4
      js/scripts.js

+ 10 - 4
js/scripts.js

@@ -3818,20 +3818,26 @@ function validate_captcha(form)
 function updateProductTotalMessage(billingcycle) {
     switch(billingcycle) {
         case 'monthly':
-            console.log("init: " + billingcycle);
+            console.log(billingcycle);
+            let days = Date(date.getFullYear(), date.getMonth() + 1, 0) - Date(date.getFullYear(), date.getMonth(), date.getDate());
+            console.log(days);
             jQuery('#producttotalmessage').html('Monatlich');
             break;
         case 'quarterly':
-            console.log("init: " + billingcycle);
+            console.log(billingcycle);
             jQuery('#producttotalmessage').html('4teljährlich');
             break;
         case 'semiannually':
-            console.log("init: " + billingcycle);
+            console.log(billingcycle);
             jQuery('#producttotalmessage').html('Halbjährlich');
             break;
         case 'annually':
-            console.log("init: " + billingcycle);
+            console.log(billingcycle);
             jQuery('#producttotalmessage').html('Jährlich');
             break;
     }
 }
+
+function daysIntoYear(date){
+    return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - Date.UTC(date.getFullYear(), 0, 0)) / 24 / 60 / 60 / 1000;
+}