Before I starting writing a helper to display a calendar I wondered if
anyone was aware of a calendar helper, basically something that is
displayed inline (not a pop-up window) that can replace a date_select.
The way I am thinking of doing it is to have a partial which is passed a
Time class, the month is extracted from the date and a grid displayed
for that month. Which should not be to difficult since there are some
nice constants in Date class which include the number of days in a
month for normal and leap years.
Each date will have a javascript onclick which will pass its value (eg.
3 if you clicked on the 3rd) to a javascript function which would store
the value in a hidden field.
Those hidden fields may translate directly in to a date when parsed by
Rails or they may need to be done manually using Time.parse.
Now the problem comes when the user needs to change the month since only
one month can be displayed at a time. So I have a link for the next and
previous month, when clicked the grid is replaced with the correct
month’s grid.
How best to do this, im thinking ajax would be the wrong choice and I
may be better to do it all client side using javascript, but then I dont
get access to the partical… so ajax it must be??