In my page, the datepicker dateFormat option is being set automatically by loading a localized .js file according to the current users's language settings. Elsewhere in the page, I need to format some dates, so I'd like to get the dateFormat option back out of the datePicker.
The jQuery documentation says you can retrieve the dateFormat option like so:
$('.selector').datepicker('option', 'dateFormat');
However, this returns a jQuery object wrapping the datePicker, not a string value as expected. Is this a bug? Is there another way to retrieve the dateValue option?
I'm using jQuery 1.3.2 and jQuery UI 1.7.1.
I know that I could simply look up the dateFormat another way, but pulling it out of the datepicker would be clean and elegant.