$("#from_date")
.datepicker({
dateFormat: "yy-mm-dd",
onSelect: function(dateText) {
$(this).change();
}
})
.change(function() {
window.location.href = "admin/from_date/" + this.value.format("yyyy-mm-dd");
});