by limiting the store of the day selector by the selected month
reported by a user in the forum:
https://forum.proxmox.com/threads/wrong-calendar.111631/
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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();
},