What are people using for date fields

I’m just curious about what techniques others have successfully used to
capture date data on forms as an alternative to the standard
date_select. I
have to admit I’ve been lazy and only used the date_select as we have
very
few dates in our system now, but that is about to change. I would like
something better.

Any thoughts?


Thanks,

Sam

I’m actually on the hunt right now as well.

I’ve briefly looked at the DateBox engine:
http://datebox.inimit.com/
http://rails-engines.org/wiki/pages/DateboxEngine

The programming interface seems a bit awkward to me, though. For
example:

<% @dateField = model.date %>
<%= date_box %>

Rather than something like

<%= date_box “model”, “date”, { options } %>

It also seems to insist on outputting an integrated help box and
additional date label, which I personally don’t want or need. However,
the actual date picker is quite nice.

Note that the SVN repository listed on the DateBox website is no
longer active. I found an alternate repository here:
Edge: http://svn.rails-engines.org/datebox_engine/trunk
1.0.0: http://svn.rails-engines.org/datebox_engine/tags/rel_1.0.0/

-Eli

Sam S. wrote:

Sam

Hi Sam,
I use text field and own parsing, so I can parse and display european
date format DD.MM.YYYY.

Bojan


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
-> tools, scripts, tricks from our code lab: http://source.mihelac.org

Thanks Robert!

Both popup_calendar and date_box use the same JS library, but I much
prefer the way that popup_calendar behaves like other form helpers and
lets you set configuration options.

However, it’s nice that date_box is set up as an engine since it
allows you to keep all of those extra .js, .css, and .gif files out of
your main public folder.

So I went ahead and converted popup_calendar into an engine and it
works great! I’ll test it for a few days and submit it… somewhere.
If anyone would like me to just send them the code, let me know.

-Eli

I’ve used the helper that is found here:

http://wiki.rubyonrails.org/rails/pages/CalendarHelper

I had used the Dynarch calendar previously in some php applications. I
had to do a little tweaking to get it how I wanted, however. (Having a
displayed input with a user-friendly format and a hidden field for the
mysql format, making it read-only and having a delete button, etc.)

When all was said and done the code to use it was just like any other
form helper:

<%= popup_calendar ‘equipment’, ‘purchase_date’ %>

It creates a read-only input with a calendar icon and delete icon.
Behind the scenes is the actual hidden field that stores a mysql date.

Also, the Dynarch calendar is open source, nice looking, and easy to
use. (I did change some CSS for my use.) Here is the site:

http://www.dynarch.com/projects/calendar

Like I said, I did do some modifications, but it seems to work well for
what I am doing.

Robert

Hey looks good any progress on that ?

Eli Gordon wrote:

Thanks Robert!

Both popup_calendar and date_box use the same JS library, but I much
prefer the way that popup_calendar behaves like other form helpers and
lets you set configuration options.

However, it’s nice that date_box is set up as an engine since it
allows you to keep all of those extra .js, .css, and .gif files out of
your main public folder.

So I went ahead and converted popup_calendar into an engine and it
works great! I’ll test it for a few days and submit it… somewhere.
If anyone would like me to just send them the code, let me know.

-Eli

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs