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"></div>
<%= 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..
<!-- Use a callback for the flat calendar//-->
<script type="text/javascript">
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);
}
};
</script>
<%= 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.