You can use some javascript to do this.
For example calendar_date_select.
1. Install the gem and add it to the configuration environment.rb
(config.gem "calendar_date_select")
2. Use hobos mechanism to extend the existing date input. A good place
is application.dryml
<!-- Enable CalendarDateSelect plugin for datetime fields -->
<extend tag="input" for="datetime">
<div class="calendar-datetime-input">
<%= calendar_date_select_tag param_name_for_this, this, :time =>
false %>
</div>
</extend>
3. Also add the JS and CSS
<extend tag="page">
<old-page merge>
<append-stylesheets:>
<stylesheet name="calendar_date_select/silver.css"
media="screen"/>
</append-stylesheets:>
<append-scripts:>
<javascript name="calendar_date_select/calendar_date_select.js"/
>
<javascript name="calendar_date_select/format_hyphen_ampm.js"/>
</append-scripts:>
</extend-tag>
If you want to filter the date in a table-plus for example, you need
to add the javascript code to handle the parameter for the GET.
Similar to this (copied from the original hobo js):
<form action="&request.request_uri" class="filter-menu"
method="get">
<div>
<%= calendar_date_select_tag "startdate", @sel_startdate,
:year_range => 5.years.ago..0.years.ago, :onchange =>
"var paramName = this.getAttribute('name');
var params = {}
var remove = ['page']
if ($F(this) == '') {
remove.push(paramName)
} else {
params[paramName] = $F(this)
}
location.href = Hobo.addUrlParams(params, {remove:
remove})",
:valid_date_check => "date < (new Date()).stripTime()"
%>
</div>
</form>
Sebastian
On 8 Jun., 21:26, storitel <[email protected]> wrote:
> hi folks
> seems like an obvious thing, but i can't find a hobo example for
> inputing a date via a popup calendar... has anyone got a simple recipe
> for this?
>
> btw - our hobo crm app went live this week, initially 10 users...it
> was running fine until heroku went down today...
>
> br
> Paul
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.