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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060711/0fee442f/attachment.html
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 On 7/11/06, Sam Schroeder <samuelschroeder@gmail.com> wrote:> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Sam Schroeder wrote:> 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, > > SamHi Sam, I use text field and own parsing, so I can parse and display european date format DD.MM.YYYY. Bojan -- Bojan Mihelac Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com -> tools, scripts, tricks from our code lab: http://source.mihelac.org
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 -- Posted via http://www.ruby-forum.com/.
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 On 7/12/06, robert bradford <rbradford@khov.com> wrote:> 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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-- Posted via http://www.ruby-forum.com/.