All pastes #2058428 Raw Edit

Anonymous

public text v1 · immutable
#2058428 ·published 2011-05-13 16:35 UTC
rendered paste body
<novalis_> All date fields were supposed to be inclusive of the start date and exclusive of the end date.  That one ended up not being that way was due to my misunderstanding of ruby
<novalis_> http://c2.com/cgi/wiki?WhyNumberingShouldStartAtZero <-- this is the reasoning
* acochran 's eyes glaze over 
<novalis_> Anyway, it is a more-or-less standard programming convention to do ranges that way.
<novalis_> One advantage that even non-programmers can see is that you don't have to remember what the end date of a month is
<novalis_> So, if I want the month of may, I can say May 1 to June 1 rather than having to go, well, 30 days has september....
<acochran> i see 
<novalis_> Anyway, it was a conscious decision.  So, we should decide what the actual right thing to do is, and then I'll figure out how to do it everywhere.  Hopefully, it's what I'm already doing.
<acochran> novalis_: But don't we need all the dates to be inclusive now that we're using both the month date_select (w/o day) and the .datepicker()?
<novalis_> For month-long ranges, the idea was that you would select as your start date 5/1/2011 and your end date 6/1/2011.
<acochran> novalis_: well, in this case http://rideconn.dev.openplans.org:3000/reports , there's no day to pick
<acochran> I suppose start and end should set the day to 1 and end should add a month
<novalis_> Yeah.
* acochran tried but isn't sure how to set a default day. 
<novalis_> the day is actually already set to 1
<novalis_> (it's in a hidden field)
<acochran> ah, I see you closed the ticket where I commented about this
<acochran> I'll look at how you fixed it and apply anywhere else needed 
<novalis_> Wait, which ticket?
<acochran> https://openplans.basecamphq.com/projects/5583369-reporting-dispatch-system/todo_items/92074023/comments
<novalis_> So, I actually edited the code there.
<novalis_> There was some craziness where I was doing date minus 30 days instead of date minus one month
<novalis_> which didn't make any sense for a monthly thing
<acochran> if it's exclusive, it should be +1 month, right? 
<novalis_> I computed the end date first, since in general, we want the previous month's data rather this month's