Commit d6ea5710 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

search date

parent fc46b8a8
......@@ -18,7 +18,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
if True:
if False:
#update radio stations recotding time
print("Recording Time:")
recordingsDir = "/home/mario/virtualHDD/m3/recordings/"
......@@ -64,6 +64,7 @@ class Command(BaseCommand):
if fileDate >= lastDate.date():
with open(f) as data_file:
try:
print(f)
data = json.load(data_file)
for d in data:
newsDate = dateutil.parser.parse(d['date'])
......
......@@ -175,7 +175,8 @@ def getNewsByRequest(request):
myQuery &= Q(date__gte=(datetime.date.today()- relativedelta(years=1)).strftime("%Y-%m-%d"))
if 'endDate' in request.GET and request.GET['endDate']!="None" and request.GET['endDate']!="":
myQuery &= Q(date__lte=request.GET['endDate'])
edate = datetime.datetime.strptime(request.GET['endDate'], "%Y-%m-%d").date() + relativedelta(days=1)
myQuery &= Q(date__lte=edate.strftime("%Y-%m-%d"))
if "text" in request.GET and request.GET['text']!="None" and request.GET['text']!="":
# myQuery &= Q(text__search=request.GET['text'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment