-
-
I like solving social problems with web and mobile technology. I also like playing funk music. README
-
iPhone Apps
-
Read About
ActionScript3 adobe flex Ajax apache authentication bash csrf custom devise Facebook API flash flex iphone javascript jquery linux marketing Music myspace MySQL objective c os x passenger Photoshop php plugin rails rounded rounded corners rspec ruby rubyonrails Ruby On Rails Software SQLite tap testing time_select user-permissions user-roles validation widget wordpress XHTML/CSS XML

Simple Quarter Select – Rails plugin for Q1,Q2,Q3,Q4 selector
Have you ever wanted a select component for Quaters of the Fiscal Year (Q1,Q2,Q3,Q4)? The Simple Quarter Select Ruby on Rails plugin does it for you. It’s highly configurable and maps to the month of any datetime attribute in your model.

Why map the quarter to a datetime attribute?
I think the answer is obvious but for the sake of being comprehensive, I’ll list 3 questions to guide your decision:
1) How else would you store the information in your database?
2) What if some of your objects are quarterly but others are actual dates? How about semiannual?
3) How would your sort-by-date query look?
If you answer these 3 questions, you will likely see the logic in my decision.
Installation
Get it or view the source here
Usage
It’s really easy to use. Just toss this code into your view:
Configurability
Simple Quarter Select has a misleading name. It should really be called “Named Month Intervals” because that represents its true flexibility. To illustrate this, let’s look at an example. Let’s say you want your users to be able to choose from two halves of a year:
“H1″ would store as 01/01/YYYY and “H2″ would store as 07/01/YYYY.
Or maybe you just want to display the full word “Quarter” in each option:
You get the idea
Let me know if you find this plugin useful or find any bugs. Enjoy!
If you enjoyed this post, make sure you subscribe to my RSS feed!