-
-
Save leejarvis/8bf03db18e90afe0a047 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/chronic/repeaters/repeater_day_portion.rb b/lib/chronic/repeaters/repeater_day_port | |
index 651cfd0..73f187f 100644 | |
--- a/lib/chronic/repeaters/repeater_day_portion.rb | |
+++ b/lib/chronic/repeaters/repeater_day_portion.rb | |
@@ -66,8 +66,13 @@ module Chronic | |
def this(context = :future) | |
super | |
- range_start = Chronic.construct(@now.year, @now.month, @now.day) + @range.begin | |
- @current_span = Span.new(range_start, range_start + (@range.end - @range.begin)) | |
+ if context == :past | |
+ range_start = Chronic.construct(@now.year, @now.month, @now.day - 1) + @range.begin | |
+ else | |
+ range_start = Chronic.construct(@now.year, @now.month, @now.day) + @range.begin | |
+ end | |
+ | |
+ Span.new(range_start, range_start + (@range.end - @range.begin)) | |
end | |
def offset(span, amount, pointer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment