Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 2266)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 2276)
@@ -1340,9 +1340,4 @@
         startdate = extractonly.get("start")
         enddate = extractonly.get("end")
-        for limit in ("start", "end") :
-            try :
-                del extractonly[limit]
-            except KeyError :    
-                pass
         (startdate, enddate) = self.cleanDates(startdate, enddate)
         entries = self.retrieveHistory(user, printer, hostname=extractonly.get("hostname"), billingcode=extractonly.get("billingcode"), limit=None, start=startdate, end=enddate)
Index: pykota/trunk/pykota/storage.py
===================================================================
--- pykota/trunk/pykota/storage.py (revision 2268)
+++ pykota/trunk/pykota/storage.py (revision 2276)
@@ -601,29 +601,37 @@
         now = DateTime.now()    
         nameddates = ('yesterday', 'today', 'now', 'tomorrow')
-        if ((startdate.lower() in nameddates) or startdate.isdigit()) and \
-           ((enddate.lower() in nameddates) or enddate.isdigit()) : 
-            datedict = { "start" : startdate, "end" : enddate }    
-            for limit in datedict.keys() :
-                dateval = datedict[limit]
-                if dateval in nameddates :
+        datedict = { "start" : startdate.lower(), "end" : enddate.lower() }    
+        for limit in datedict.keys() :
+            dateval = datedict[limit]
+            for name in nameddates :
+                if dateval.startswith(name) :
+                    try :
+                        offset = int(dateval[len(name):])
+                    except :    
+                        offset = 0
+                    dateval = dateval[:len(name)]    
                     if limit == "start" :
                         if dateval == "yesterday" :
-                            dateval = (now - 1).Format("%Y%m%d000000")
+                            dateval = (now - 1 + offset).Format("%Y%m%d000000")
                         elif dateval == "today" :
-                            dateval = now.Format("%Y%m%d000000")
+                            dateval = (now + offset).Format("%Y%m%d000000")
                         elif dateval == "now" :
-                            dateval = now.Format("%Y%m%d%H%M%S")
+                            dateval = (now + offset).Format("%Y%m%d%H%M%S")
                         else : # tomorrow
-                            dateval = (now + 1).Format("%Y%m%d000000")
+                            dateval = (now + 1 + offset).Format("%Y%m%d000000")
                     else :
                         if dateval == "yesterday" :
-                            dateval = (now - 1).Format("%Y%m%d235959")
+                            dateval = (now - 1 + offset).Format("%Y%m%d235959")
                         elif dateval == "today" :
-                            dateval = now.Format("%Y%m%d235959")
+                            dateval = (now + offset).Format("%Y%m%d235959")
                         elif dateval == "now" :
-                            dateval = now.Format("%Y%m%d%H%M%S")
+                            dateval = (now + offset).Format("%Y%m%d%H%M%S")
                         else : # tomorrow
-                            dateval = (now + 1).Format("%Y%m%d235959")
-                        
+                            dateval = (now + 1 + offset).Format("%Y%m%d235959")
+                    break
+                    
+            if not dateval.isdigit() :
+                dateval = None
+            else :    
                 lgdateval = len(dateval)
                 if lgdateval == 4 :
@@ -661,11 +669,9 @@
                 except :    
                     dateval = None
-                datedict[limit] = dateval    
-            (start, end) = (datedict["start"], datedict["end"])
-            if start > end :
-                (start, end) = (end, start)
-            return (start, end)    
-        else :            
-            return (None, None)
+            datedict[limit] = dateval    
+        (start, end) = (datedict["start"], datedict["end"])
+        if start > end :
+            (start, end) = (end, start)
+        return (start, end)    
         
 def openConnection(pykotatool) :
Index: pykota/trunk/pykota/version.py
===================================================================
--- pykota/trunk/pykota/version.py (revision 2268)
+++ pykota/trunk/pykota/version.py (revision 2276)
@@ -22,5 +22,5 @@
 #
 
-__version__ = "1.23alpha5_unofficial"
+__version__ = "1.23alpha6_unofficial"
 
 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS and LPRng."
