lib/evertils/actions/duplicate_previous.rb in evertils-2.3.2 vs lib/evertils/actions/duplicate_previous.rb in evertils-2.3.3

- old
+ new

@@ -23,13 +23,22 @@ def grammar terms = Grammar.new terms.notebook = @args[:notebook] terms.tags = { - day: (Date.today.yday - 1) + day: (Date.today.yday - 1), + week: week } terms.created = Date.new(Date.today.year, 1, 1).strftime('%Y%m%d') terms + end + + def week + this_week = Date.today.cweek + + return this_week - 1 if Date.today.monday? + + this_week end end end end