Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] Ruby Month 0.1.0

0 views
Skip to first unread message

Francis Hwang

unread,
Jun 7, 2005, 9:49:39 AM6/7/05
to
From out of murky depths of the Lafcadio codebase, I bring you a tiny
utility library called Ruby Month. It's a modest thing, intended to
make month-level manipulations easier.

http://rubyforge.org/projects/month

For example:

require 'month'
jun2005 = Month.new( 2005, 6 )
jun2005.to_s # => "Jun 2005"
jun2005.start_date.to_s # => "2005-06-01"
jun2005.end_date.to_s # => "2005-06-30"

jul2005 = jun2005.next
jul2005.to_s # => "Jul 2005"
may2005 = jun2005.prev
may2005.to_s # => "May 2005"

to_sort = [ jul2005, may2005, jun2005 ]
to_sort.join ', ' # => "Jul 2005, May 2005, Jun
2005"
to_sort.sort!
to_sort.join ', ' # => "May 2005, Jun 2005, Jul
2005"

Hope you find it useful!

Francis Hwang
http://fhwang.net/

John Wilger

unread,
Jun 7, 2005, 11:21:07 AM6/7/05
to
On 6/7/05, Francis Hwang <se...@fhwang.net> wrote:
> From out of murky depths of the Lafcadio codebase, I bring you a tiny
> utility library called Ruby Month. It's a modest thing, intended to
> make month-level manipulations easier.

> Hope you find it useful!

Awesome! I'm sure I will. Thanks.

--
Regards,
John Wilger

-----------
Alice came to a fork in the road. "Which road do I take?" she asked.
"Where do you want to go?" responded the Cheshire cat.
"I don't know," Alice answered.
"Then," said the cat, "it doesn't matter."
- Lewis Carrol, Alice in Wonderland


0 new messages