lib/timetrap/helpers.rb in timetrap-1.9.0 vs lib/timetrap/helpers.rb in timetrap-1.10.0
- old
+ new
@@ -48,9 +48,14 @@
else
Timetrap::Entry.filter('sheet = ?', Timer.current_sheet)
end
ee = ee.filter('start >= ?', Date.parse(Timer.process_time(args['-s']).to_s)) if args['-s']
ee = ee.filter('start <= ?', Date.parse(Timer.process_time(args['-e']).to_s) + 1) if args['-e']
+ ee = ee.order(:start)
+ if args['-g']
+ re = Regexp::new(args['-g'])
+ ee = ee.find_all{|e| re.match(e.note)}
+ end
ee
end
def format_time time
return '' unless time.respond_to?(:strftime)