Method: Doing::WWID#yesterday

Defined in:
lib/doing/wwid/display.rb

#yesterday(section, times = nil, output = nil, opt) ⇒ Object

Show entries from the previous day

Parameters:

  • section (String)

    The section

  • times (Bool) (defaults to: nil)

    Show times

  • output (String) (defaults to: nil)

    Output format

  • opt (Hash)

    Additional Options



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/doing/wwid/display.rb', line 186

def yesterday(section, times = nil, output = nil, opt)
  opt ||= {}
  opt[:totals] ||= false
  opt[:sort_tags] ||= false
  opt[:config_template] ||= 'today'
  opt[:yesterday] = true

  section = guess_section(section)
  y = (Time.now - (60 * 60 * 24)).strftime('%Y-%m-%d')
  opt[:after] = "#{y} #{opt[:after]}" if opt[:after]
  opt[:before] = "#{y} #{opt[:before]}" if opt[:before]

  opt[:output] = output
  opt[:section] = section
  opt[:times] = times
  opt[:count] = 0

  list_section(opt)
end