Monday, 5 November 2012

Time Helper 2.0.0 released

Funny how time-helper is older than this blog yet not a single post or page about it here.

I've considered this a new major version because there's no guarantee of compatibility with previous versions, in a couple features.

About version 2.0.0

I've changed the =~, the old way was just stupid (no one else to blame but me here), the new version just compares two Time objects and see if they are within an acceptable distance from each other in seconds, defaults to 300 (5 minutes).
So where you'd have a symbol as first argument you now have a Fixnum. Also added a sanity check for the second argument.

Completely removed the #parse integration in #strtotime, this means that if you were using #strtotime as both it won't work, as such, it reduces the memory footprint of this gem (by not requiring stdlib time)  for those who don't want .parse - which is most of the people that I've made this gem for (including myself).

And yes, this gem still doesn't care about American date format (mm/dd/yyyy), because it's silly.

I've already found a couple issues that need to be fixed:
  • Documentation for =~ doesn't completely reflex the changes.
  • Time.valid_datetime? returns true for more than intended inputs.