daterangepicker question

286 views
Skip to first unread message

kleiascent

unread,
Apr 7, 2009, 8:47:50 PM4/7/09
to jQuery UI Development
hello...
i have been able to implement much of the daterangepicker and the more
i use jQuery and jQuery UI the more I becoming an addict. However, I
am still a feeble noob.

I will be happy to post my code, however not sure what tags to use to
do that (can't find anything in the help section of google for groups
sorry...)

what i'm trying to do is create an auto date range system... both
calendars appear and yes they will change the date when the dates are
selected, however, I want to automatically have the date appear in the
second text field when the date is selected for the first text field,
and also have the second calendar in the date range picker change to
that date...

just haven't any idea how to do it...

if someone can indicate to me how to post my code, I'll be happy to do
so. It functions as it is right now, however, it requires more
functionality.

You're all genius so it would be nice to get some of your advice.

ScottJehl

unread,
Apr 8, 2009, 11:45:34 AM4/8/09
to jQuery UI Development
Thanks for your question.
The widget you're talking about is actually not an official jQuery UI
plugin, but rather a custom widget by Filament Group.

Reference article here:
http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/


To answer your question, you can probably do what you're attempting by
using the plugin's "datepickerOptions" option, which is just a way to
get to the options for each jQuery UI datepicker widget in the
rangepicker. You could use the datepicker's onSelect callbac, check
the second input's value and if it is empty, populate it with the
value from the first input.

Something like....

$('#inputA, #inputB').daterangepicker( {
datepickerOptions: {
onSelect: function(dateText) {
if($('#inputB').val() == ""){
$('#inputB').val(dateText);
}
}
}
});


In the future, please post a comment on that article page so your
question will be seen by the right people.
-Scott, Filament Group

Reply all
Reply to author
Forward
0 new messages