# What are people using for date fields

**URL:** <https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010>\
**Category:** Rails\
**Created:** [July 11, 2006, 11:38pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010 "2006-07-11T23:38:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 11, 2006, 11:38pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/1 "2006-07-11T23:38:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 12, 2006, 1:02am UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/2 "2006-07-12T01:02:56Z")

</div>

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

I’ve briefly looked at the DateBox engine:  
[http://datebox.inimit.com/](http://datebox.inimit.com/)  
[http://rails-engines.org/wiki/pages/DateboxEngine](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](http://svn.rails-engines.org/datebox_engine/trunk)  
1.0.0: [http://svn.rails-engines.org/datebox\_engine/tags/rel\_1.0.0/](http://svn.rails-engines.org/datebox_engine/tags/rel_1.0.0/)

-Eli

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 12, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/3 "2006-07-12T18:10:46Z")

</div>

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](http://www.informatikamihelac.com)  
 → tools, scripts, tricks from our code lab: [http://source.mihelac.org](http://source.mihelac.org)

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 13, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/4 "2006-07-13T18:16:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 12, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/5 "2006-07-12T18:25:27Z")

</div>

I’ve used the helper that is found here:

[http://wiki.rubyonrails.org/rails/pages/CalendarHelper](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](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

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [July 15, 2006, 10:45pm UTC](https://www.ruby-forum.com/t/what-are-people-using-for-date-fields/98010/6 "2006-07-15T22:45:21Z")

</div>

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
