Skip to content
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

Requires a DateRange's "end" to be after its "start" #1425

Merged
merged 3 commits into from Aug 18, 2015

Conversation

benpence
Copy link
Contributor

No description provided.

@johnynek
Copy link
Collaborator

merge when green

@@ -73,6 +73,7 @@ object DateRange extends java.io.Serializable {
*/
case class DateRange(val start: RichDate, val end: RichDate) {
import DateOps._
require(start <= end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error message here would be nice

require(start <= end, "end of date range must not occur before the start")

@rubanm
Copy link
Contributor

rubanm commented Aug 18, 2015

+1

@benpence
Copy link
Contributor Author

Should I add an error message? I just remembered you could do that

@johnynek
Copy link
Collaborator

Yes;

require(start <= end, s"$start is not on or before $end")

On Mon, Aug 17, 2015 at 2:10 PM, Ben Pence notifications@github.com wrote:

Should I add an error message? I just remembered you could do that


Reply to this email directly or view it on GitHub
#1425 (comment).

Oscar Boykin :: @posco :: http://twitter.com/posco

benpence added a commit that referenced this pull request Aug 18, 2015
Requires a DateRange's "end" to be after or on its "start"
@benpence benpence merged commit 6f40538 into twitter:develop Aug 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants