bernat/best_in_place — Issue #89: Set initial format for datepicker field
Author: sjf-control
Created: 2012-01-18 13:51:10+00:00
State: open

Is there a procedure for setting the date format for the field prior to activation of the BIP date picker?
I have "$.datepicker.setDefaults({ dateFormat: 'mm/dd/yy' });" in application.js, but the field (prior to date picker activation) is displaying in 'yy/mm/dd' format. Once the dat picker has been activated, and a date selected, the display changes to the proper 'mm/dd/yy' format.

Using a non-BIP (regular edit form) field, with jquery_datepicker gem ( https://github.com/albertopq/jquery_datepicker ), I can define a datepicker field in my view using

```
<%= f.datepicker( :completion_date,
dateFormat: 'mm/dd/yy',
value: "#{@class_time.completion_date.strftime("%Y/%m/%d")}",
showAnim: :slide )%>
```
Which properly formats the initial value of the edit field prior to datepicker activation.

But I can'f figure out how to do a similar thing within BIP.

Thanks for any help
(I presume this is the proper place to ask for help of this nature. If there is a more appropriate place, kindly direct me to it. Thanks.)