accountant_date

accountant_date monkey-patches ruby’s Date class to add parsing functionality useful for parsing dates entered by accountants.

This gem is based on american style dates (e.g., mm/dd/yy) and is compatible with (american_date).

Accountants often deal with financial periods (mm/yy) and they also hate typing extra characters (e.g., ‘/’) since they enter so many dates. This gem enables ruby to parse the following formats:

  • [m]1,2/yy

  • [m]1,2yy

  • [m]1,2ddyy

In other words, to parse 1 Feb 2001, the following date entries could be parsed:

  • 201

  • 0201

  • 02/01

Or to get 3 Feb 2001:

  • 20301

  • 020301

  • 2/3/01

Thanks

A big thanks to Jeremy Evans for the inspiration provided by his american_date gem: github.com/jeremyevans/ruby-american_date.

Contributing to accountant_date

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2013 Ryan Winograd. See LICENSE.txt for further details.