[ANN] Ruby Month 0.1.0

F

Francis Hwang

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/
 
J

John Wilger

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. =20
Hope you find it useful!

Awesome! I'm sure I will. Thanks.

--=20
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,162
Messages
2,570,893
Members
47,432
Latest member
GTRNorbert

Latest Threads

Top