Re: Need Help With Datebock plugin

Conrad Taylor
Thu, 29 Mar 2007 20:10:46 -0000

Hey Nathaniel, this is some very good work.  Now, is it possible to to
disable the input field because on an new/edit view screen I would
like them to simply use the calendar to set/change the date?

Thanks,

-Conrad

On 3/29/07, Nathaniel Brown <nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org>
wrote:
>
> Hey Conrad,
>
> As I said, I haven''t done this before, so there is no
"simple" way to
> do it yet with the library, but the library will provide full access
> to integrate it. The calendar_options param passes through all the
> options to the Calendar.setup initialization.
>
> http://www.dynarch.com/demos/jscalendar/simple-2.html
>
> So.. something like this would work....
>
>
> ...... ok so axe all that.
>
> I just spent the morning hacking away at it :) And voila... v3.0.3
>
> You can now do this..
>
> <div style="float: right;"
id="calendar-container">
> <%= toolbocks_date_select :model, :column, {}, { :flat =>
> ''calendar-container'' } %>
>
> or to have Datetime Toolbocks do everything for you and make it even
> simpler, try this..
>
> <%= toolbocks_date_select(:model, :column, {}, { :flat => true })
%>
>
> or to do something like the example in the dynarch.com website above..
>
>
>
>   function dateChanged(calendar) {
>     // Beware that this function is called even if the end-user only
>     // changed the month/year.  In order to determine if a date was
>     // clicked you can use the dateClicked property of the calendar:
>     if (calendar.dateClicked) {
>       // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
>       var y = calendar.date.getFullYear();
>       var m = calendar.date.getMonth();     // integer, 0..11
>       var d = calendar.date.getDate();      // integer, 1..31
>
>       var url = "/search/" + y + "/" + m +
"/" + d;
>
>       // redirect...
>       // window.location = url;
>
>       // announce a possible URL to go to
>       alert(url);
>     }
>   };
>
>   <%= toolbocks_date_select(:model, :column, {}, { :flat => true,
> :flatCallback => ''javascript:dateChanged'' }) %>
>
> You can also checkout all the demos I use to test with here..
>
>
http://svn.toolbocks.com/plugins/datetime_toolbocks/app/views/datetime_toolbocks/_demos.rhtml
>
> Enjoy!
>
> Nathaniel.
>
> On 3/29/07, Conrad Taylor
<conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > Hi Nathaniel, I was looking for option(s) to create an inline calendar
> > using the datetime toolbooks?
> >
> > -Conrad
> >
> > On 3/29/07, Nathaniel Brown
<nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org> wrote:
> > >
> > > Hey Conrad,
> > >
> > > You could have used
> > >
> > > http://svn.toolbocks.com/demos/datetime_toolbocks/
> > >
> > > Instantly up and running app :)
> > >
> > > Dlo, that might work for you as well. As a working reference
anyways.
> > > That''s whats running on http://datetime.toolbocks.com
> > >
> > > Nathaniel.
> > >
> > > On 3/28/07, Conrad Taylor
<conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > > >
> > > > Hi dlo, I was able to successfully install it.  BTW, I was
using Ruby
> > > > 1.8.6, Rails 1.2.3, Engines 1.2, and Rake 0.7.2.  It took me
about 20
> > > > minutes to get a test application up and operational using
the most
> > > > current version of Datetime Toolbocks.
> > > >
> > > > -Conrad
> > > >
> > > > On 3/21/07, dlo
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
> > > > >
> > > > > Hi everyone,
> > > > >
> > > > > I''m using currently Ruby 1.8.4, Rails 1.2.3,
Rake 0.7.2, Engines 1.2, &
> > > > > Datebocks 2.03.  I followed the instructions on
> > > > > http://datebocks.inimit.com/  I''m getting this
error undefined method
> > > > > `engine_image''.
> > > > >
> > > > > Here is the code:
> > > > >
> > > > >
> > > > > Start Date:
> > > > >   <%=
datebocks_field(''table_rate'', ''date_column'')
%>
> > > > >
> > > > >
> > > > > I added ''include DatebocksEngine'' to
both the application and
> > > > > application helper, also, I added
> > > > >
> > > > > <%= engine_javascript "datebocks_engine",
"calendar",
> > > > > "lang/calendar-en",
"calendar-setup" %>
> > > > >   <%= engine_stylesheet
"datebocks_engine", "calendar-win2k-cold-1.css"
> > > > > %>
> > > > >
> > > > > to my layout.
> > > > >
> > > > > Lastly I tried adding Engines.start :datebocks to my
environment.rb, but
> > > > > that doesn''t work with Engines 1.2
> > > > >
> > > > >
> > > > > Did anyone successfully get Datebocks to work on
Engines 1.2?  Is there
> > > > > a way to revert back to an older version?  Or if
someone did get it to
> > > > > work with different versions, could you please tell me
how to install
> > > > > older versions of Rails or Engines to get this to work.
I do not have
> > > > > any previous versions of Rails installed on my
computer. There really
> > > > > isn''t that much about Datebocks and Engines
1.2.  Thanks in advance
> > > > >
> > > > > dlo
> > > > >
> > > > > --
> > > > > Posted via http://www.ruby-forum.com/.
> > > > >
> > > > > >
> > > > >
> > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > Nathaniel Steven Henry Brown
> > >
> > > Toll Free: 1-877-446-4647
> > > Vancouver: 604-724-6624
> > >
> > > >
> > >
> >
> > >
> >
>
>
> --
> Nathaniel Steven Henry Brown
>
> Toll Free: 1-877-446-4647
> Vancouver: 604-724-6624