0
votes

I haven't found an answer or even a hint as to how to do this. I have a form that has a date input field pre-populated from my database. This is working just fine. What I'm wondering about is whether it is possible to have the default date on this datepicker be different than the pre-populated field.

For example, the date is a date that periodically needs to be updated. If the date from the database shows, "12-31-2007", but now I need to update the date to today's date, I have to go through several steps to get today's date to show when the datepicker field is clicked. I'd like the calendar to default to today's date on this field, so that updating the date in the database is simple and easy.

I've tried using the defaultDate parameter, but because the field is pre-populated, then the defaultDate doesn't affect the shown date.

Any thoughts? Thanks in advance.

1

1 Answers

0
votes

I ended up using this:

$('.date').datepicker({showButtonPanel: true});

And because this is for a intranet web app, I adjusted the jQuery source code using this answer from SO: https://stackoverflow.com/a/7613795/652519