Skip to content

Instantly share code, notes, and snippets.

/gist:3836116
Created Oct 4, 2012

Embed
What would you like to do?
def CasesOpenedBeforeDate(self, beforedate = None):
if beforedate == None:
pass
else:
self.tempcaselist = []
beforemonth, beforeday, beforeyear = beforedate.split('/')
beforedate = date(int(beforeyear), int(beforemonth), int(beforeday))
for acase in self.caselist:
casemonth, caseday, caseyear = acase['Date Added'].split('/')
casedate = date(int(caseyear), int(casemonth), int(caseday))
if casedate < beforedate:
self.tempcaselist.append(acase)
self.caselist = self.tempcaselist
def CasesOpenedAfterDate(self, afterdate = None):
if afterdate == None:
pass
else:
self.tempcaselist = []
aftermonth, afterday, afteryear = afterdate.split('/')
afterdate = date(int(afteryear), int(aftermonth), int(afterday))
for acase in self.caselist:
casemonth, caseday, caseyear = acase['Date Added'].split('/')
casedate = date(int(caseyear), int(casemonth), int(caseday))
if casedate > afterdate:
self.tempcaselist.append(acase)
self.caselist = self.tempcaselist
def CasesClosedBeforeDate(self, beforedate = None):
if beforedate == None:
pass
else:
self.tempcaselist = []
beforemonth, beforeday, beforeyear = beforedate.split('/')
beforedate = date(int(beforeyear), int(beforemonth), int(beforeday))
for acase in self.caselist:
casemonth, caseday, caseyear = acase['Date Closed'].split('/')
casedate = date(int(caseyear), int(casemonth), int(caseday))
if casedate < beforedate:
self.tempcaselist.append(acase)
self.caselist = self.tempcaselist
def CasesClosedAfterDate(self, afterdate = None):
if afterdate == None:
pass
else:
self.tempcaselist = []
aftermonth, afterday, afteryear = afterdate.split('/')
afterdate = date(int(afteryear), int(aftermonth), int(afterday))
for acase in self.caselist:
casemonth, caseday, caseyear = acase['Date Closed'].split('/')
casedate = date(int(caseyear), int(casemonth), int(caseday))
if casedate > afterdate:
self.tempcaselist.append(acase)
self.caselist = self.tempcaselist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.