Setting Datepicker default options (e.g. firstDay)

33 views
Skip to first unread message

Jonas Bang

unread,
Aug 15, 2012, 5:11:54 AM8/15/12
to actives...@googlegroups.com
I found this blog post regarding setting Datepicker default options:
http://vhochstein.wordpress.com/2010/09/18/activescaffold-using-dates-with-jquery/

When testing it I can get it to work on a controller level:
conf.columns[:founded_at].options = {'date:firstDay' => 1}

But I can not get it to work as a default option set in the locale file, nothing happens:
en:
  active_scaffold:
    date_picker_options:
      firstDay: 1


Is it not possible to set this globally, or should it be configured in another way?

I'm using Rails 3.1.8 and AS 3.2.12.

Br,
Jonas

Sergio Cambra

unread,
Aug 16, 2012, 3:35:39 AM8/16/12
to actives...@googlegroups.com
It works. Are you testing it in development? I had to edit a js file to get it
picking my changes in locale. In production, it works precompiling assets

Jonas Bang

unread,
Aug 16, 2012, 4:43:38 AM8/16/12
to actives...@googlegroups.com
Yes, I'm testing in Development.
Which js file did you have to edit to get it to work in Development, and what did you edit in that file?

Thanks,
Jonas

Sergio Cambra

unread,
Aug 16, 2012, 4:52:28 AM8/16/12
to actives...@googlegroups.com
I changed date_picker_bridge, from ActiveScaffold. Maybe deleting
tmp/cache/assets fix it too

Jonas Bang

unread,
Aug 16, 2012, 5:02:00 AM8/16/12
to actives...@googlegroups.com
Excellent :o)

Deleting assets cache solves it in Development, and performing an asset precompile in Production also works.

Thanks for the help.

Br,
Jonas
Reply all
Reply to author
Forward
0 new messages