-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CDS2015, a new DateGeneration rule #212
Conversation
ql/time/schedule.cpp
Outdated
Integer skip = 3 - m%3; | ||
result += skip*Months; | ||
} | ||
Month m = result.month(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible that this is called when rule is Twentieth
, and in this case the adjustment to IMM month shouldn't be performed, should it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! Let me revert that.
ql/time/schedule.cpp
Outdated
Date next20th = nextTwentieth(effectiveDate, *rule_); | ||
*rule_ == DateGeneration::CDS || | ||
*rule_ == DateGeneration::CDS2015) { | ||
Date next20th = nextTwentieth(effectiveDate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rule
might be Twentieth
here, see comment above.
ql/time/schedule.cpp
Outdated
isRegular_.push_back(true); | ||
*rule_ == DateGeneration::CDS || | ||
*rule_ == DateGeneration::CDS2015) { | ||
if (*rule_ == DateGeneration::CDS2015) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be an else if
branch of the previous if
, instead of being nested.
the or statement never did anything
This closes #138.