I am trying to change the date format from the default to %d-%m-%Y. I
have
<p><label for="item_watch_start_date">Watch Start Date</label><br/>
<%= calendar_box 'item', 'watch_start_date', {:class => 'date'},
{ :ifFormat => "%d-%m-%Y", :daFormat => "%d-%m-%Y"
}
%>
But that doesn't do anything. It still displays in the default format.
Any ideas how I can get the text field to display in %d-%m-%Y format?
Thanks,
vps
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default]
and
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[:default]
Changes these values to change DhtmCalendar's formats.
Thanks.
I am sure that the dates displayed would be OK but have you tried edit/
create and then check if the dates are saved ?
> > > vps- Hide quoted text -
>
> - Show quoted text -
Yes, it works fine.
But another question. I want the calendar box to initialize with a
default value of say '01-01-2007'.
I tried these
A)
<%= calendar_box 'item', 'watch_start_date', {:class => 'date', :value
=> '01-01-2007'} %>
B)
<%= calendar_box 'item', 'watch_start_date', {:class => 'date'},{:date
=> '01-01-2007'} %>
But neither of them display anything in the text field. Any ideas what
I am doing wrong.
Thanks,
vps
On Sep 25, 7:58 pm, CCH <c...@karensoft.com.my> wrote:
> Hi Hailatu
>
> I am sure that the dates displayed would be OK but have you tried edit/
> create and then check if the dates are saved ?
>
> On Sep 26, 5:06 am, haillatu <vpsh...@gmail.com> wrote:
>
> > Excellent! Thanks much.
>
> > On Sep 20, 3:34 pm, Ed Moss <edwin.m...@gmail.com> wrote:
>
> > > Format is controlled via:
>
> > > ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default]
>
> > > and
>
> > > ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS[:default]
>
> > > Changes these values to change DhtmCalendar's formats.
>
> > > Thanks.
> > > On Aug 24, 10:20 am, haillatu <vpsh...@gmail.com> wrote:
>
> > > > Hello,
>
> > > > I am trying to change thedateformat from thedefaultto %d-%m-%Y. I
> > > > have
> > > > <p><label for="item_watch_start_date">Watch StartDate</label><br/>