This is in a post index view file
<input type="hidden" id="dp" />
this is in the posts.js file
$("#dp").datepicker({
buttonImage: '../images/icon_star.gif',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
showOn: 'both',
});