]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/StatTimeSelector.js
quarantine list: cope with undefined mail value
[pmg-gui.git] / js / StatTimeSelector.js
index f01b058e778b7aa7e0f5ad3485218fddc6ebf969..81958ebf9e4da7b66f20e09c030e8223e5cb065e 100644 (file)
@@ -73,7 +73,20 @@ Ext.define('PMG.StatTimeSelector', {
            Ext.GlobalEvents.fireEvent('pmgStatTimeSelectorUpdate', data);
        },
 
+       updateMaxDays: function() {
+           let year = this.lookup('yearsel').getValue();
+           let month = this.lookup('monthsel').getValue();
+           // get last day of current month by wrapping back day 0 from next (zero indexed) month
+           let maxDays = new Date(year, month, 0).getDate();
+           this.lookup('daysel').getStore().setFilters([{
+               property: 'day',
+               operator: '<=',
+               value: maxDays,
+           }]);
+       },
+
        onSelect: function() {
+           this.updateMaxDays();
            this.updateVisibility();
        },