I can't believe how complicated the date picker can be. I have looked at various questions on Stackoverflow, but can't get the formatting to work. I used the Railscasts #213 Calendars (revised) to set up the jQuery Datepicker.
Here in South Africa we use the dd/mm/yyyy formating and not the mm/dd/yyyy formatting as everyone says.
First problem is when I pick the date it shows up on the form as mm/dd/yyyy. I can't change this - tried changing the Coffee Script, but that doesn't do anything:
jQuery ->
$('#post_date').datepicker()
dateFormat: "dd/mm/yy"
minDate: "1w"
After it posted it shows up as mm/dd/yyyy, but now I want the date to show up in words and with the folowing code 1 April 2013 comes out as 4 January 2013.
<%= @post.date.strftime("%b %d %Y") %>
Ive tried installing I18n and setting the default on the en.yml, but that has no effect:
date:
formats:
default: "%d/%m/%y"
Please can someone please give a straight answer as to how to do this????