views:

1220

answers:

3

How do I hide the prev/today/next navigation in jQuery DatePicker?

I'm happy with just the Month and Year drop down boxes.

Also how do I disable the animations?

@tvanfosson - I already tried 'hideIfNoPrevNext' but that only works if you don't have a date range that spans two months. The duration option did the trick at turning off the animations though. Cheers.

Thanks
Kev

+4  A: 

You can find the options for the DatePicker control at http://docs.jquery.com/UI/Datepicker/datepicker#options. Specifically, I think you want to set hideIfNoPrevNext to true and set duration to ''.

  $('#cal').datepicker( { hideIfNoPrevNext: true, duration: '' } );
tvanfosson
+2  A: 

You can hide prev/next navigation via css. You can see examples which do it in themes http://marcgrabanski.com/pages/code/jquery-ui-datepicker

I eventually worked it out by fiddling with the CSS theme, but thanks for the answer.
Kev
+1  A: 

Just hide buttons

$("div.ui-datepicker-header a.ui-datepicker-prev,div.ui-datepicker-header a.ui-datepicker-next").hide();
ukko