misiek
1/18/2006 10:51:00 PM
hmm
from the form I got date variables 'time_in' and 'time_out'
<%= form_remote_tag(
:url => { :action => :"check_sick", :controller => "hour" ,:id => @user
, :super_id => @super_user},
:confirm => "Are you sure you ? ") %>
from<%= date_select("time_out","time_out")%> - to <%=
date_select("time_in","time_in")%>
<input type="submit" value="sick_days" class="text_table">
</form>
by pressing the sick_days I go to check_sick action
and here I need to deduct a date
basicly I need numer of days
like '2006-12-02' - '2006-12-01' = 1
how to do that
I was trying like @params['time_in'] - @params['time_out']
but this is not correctbecause @params is a string .
I was trying also use string_to_date(@params['time_in']) but i does not
work too