Hey, I’m in the middle of the same PHP/Java to Ruby romance so I totally agree, but I just wanted to point out that in true “quick and sloppy” PHP style you could use PHP’s strtotime. Maybe something like:
strtotime((@$_GET[‘weeks’] – 2) . ‘weeks mon gmt’);
Roughly the same number of characters as your Ruby solution. One difference in output might be for the boundary case when it is actually Monday. I’m not sure how Time.monday works in Ruby and I don’t have a runtime handy to check.
Anyway, cool discovery, thanks! 3.cheers.for(“Ruby”)