[pmg-devel] [PATCH pmg-gui 1/4] MailTracker: set min/maxValue for start/end
Dominik Csapak
d.csapak at proxmox.com
Fri Apr 24 15:57:53 CEST 2020
every time the value changes, and also at the beginning
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
js/MailTracker.js | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/js/MailTracker.js b/js/MailTracker.js
index 67ad371..23f7413 100644
--- a/js/MailTracker.js
+++ b/js/MailTracker.js
@@ -27,9 +27,14 @@ Ext.define('PMG.MailTrackerFilter', {
xclass: 'Ext.app.ViewController',
- onFilterChange: function() {
+ onFilterChange: function(comp) {
var view = this.getView();
view.fireEvent('filterChanged');
+
+ let start = this.lookup('starttime');
+ let end = this.lookup('endtime');
+ end.setMinValue(start.getValue());
+ start.setMaxValue(end.getValue());
},
onSpecialKey: function(field, e) {
@@ -99,6 +104,15 @@ Ext.define('PMG.MailTrackerFilter', {
var now = new Date();
return new Date(now.getTime() - 3600000);
}()),
+ maxValue: (function() {
+ var now = new Date();
+ var tomorrow = new Date();
+ tomorrow.setDate(now.getDate()+1);
+ tomorrow.setHours(0);
+ tomorrow.setMinutes(0);
+ tomorrow.setSeconds(0);
+ return tomorrow;
+ }()),
xtype: 'promxoxDateTimeField'
},
{
@@ -114,6 +128,10 @@ Ext.define('PMG.MailTrackerFilter', {
tomorrow.setSeconds(0);
return tomorrow;
}()),
+ minValue: (function() {
+ var now = new Date();
+ return new Date(now.getTime() - 3600000);
+ }()),
xtype: 'promxoxDateTimeField'
},
{
--
2.20.1
More information about the pmg-devel
mailing list