# handle -d, --days option
# if supplied, modify either startdate or enddate accordingly
-if opt.days >= 0:
+if opt.days > 0:
enddate = startdate + dt.timedelta(opt.days)
elif opt.days < 0:
startdate = enddate + dt.timedelta(opt.days)
startdate = dt.datetime.combine(startdate, dt.time.min)
enddate = dt.datetime.combine(enddate, dt.time.max)
+
+# print(opt)
+# print(startdate)
+# print(enddate)
+
#
# Sorting options
#
# Show date range
#
if not opt.bare:
- if opt.today and opt.yesterday:
- print 'Today (%s) and yesterday' % startdate.strftime('%Y-%m-%d')
+ print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru:', enddate.strftime('%Y-%m-%d')
+
+ if False:
+ if opt.today and opt.yesterday:
+ print 'Today (%s) and yesterday' % startdate.strftime('%Y-%m-%d')
- elif opt.yesterday:
- if opt.days:
- print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru',
+ elif opt.yesterday:
+ if opt.days:
+ print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru',
- print 'Yesterday:', startdate.strftime('%Y-%m-%d')
+ print 'Yesterday:', startdate.strftime('%Y-%m-%d')
- elif opt.today:
- if opt.days:
- print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru',
+ elif opt.today:
+ if opt.days:
+ print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru',
- print 'Today:', startdate.strftime('%Y-%m-%d')
+ print 'Today:', startdate.strftime('%Y-%m-%d')
- elif startdate > LONG_AGO:
- print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru:', enddate.strftime('%Y-%m-%d')
+ elif startdate > LONG_AGO:
+ print 'From:', startdate.strftime('%Y-%m-%d'), ' Thru:', enddate.strftime('%Y-%m-%d')
- elif enddate:
- print 'Thru:', enddate.strftime('%Y-%m-%d')
+ elif enddate:
+ print 'Thru:', enddate.strftime('%Y-%m-%d')
print '-' * opt.width