Umbraco 7.2 Forms 4.0.3 Change Date in FRONT END date picker
Hi Guys,
I am trying to change the format of the date that is chosen in the Datepicker field type when it is rendered in the front end (I have changed the backend date format by changing the site culture)
Currently the date is formated as Fri Apr 17 2015 i need it to be Fri 17 Apr 2015.
Any help or pointers on this would be very much appreciated. I have noted that in the Script.cshtml that there is this line:
var contourDateFormat = "@Html.ConvertDateFormat()";
but changing this doesnt really seem to do anything.
thanks for your suggestion, however i think that your amned is for contour and not the new Umbraco Forms, the code layout for Umbraco forms seems ot be similar ,there is now a umbraco.forms.js file but I cant find where the date picker is instansiated.
Okay further looking has found that pikaday tried to use moment.js if it is available, for whatever reason though moment.js was not being output on the page. If i do output moment.js on the page then the default format string defined inpickaday is used, If i change this format string then the string displayed in the date field is altered, however if i try and make it fancy for example "Thursday, 15th April 2015" then the value is not saved in Umbraco.
I think for my case this is a would like to have requriment so I am not going ot persue it any further.
Umbraco 7.2 Forms 4.0.3 Change Date in FRONT END date picker
Hi Guys,
I am trying to change the format of the date that is chosen in the Datepicker field type when it is rendered in the front end (I have changed the backend date format by changing the site culture)
Currently the date is formated as Fri Apr 17 2015 i need it to be Fri 17 Apr 2015.
Any help or pointers on this would be very much appreciated. I have noted that in the Script.cshtml that there is this line:
var contourDateFormat = "@Html.ConvertDateFormat()";
but changing this doesnt really seem to do anything.
Thanks
L
Hi Lachlann
I've had to make similar changes, you'll need to edit this file
\umbraco\plugins\umbracoContour\scripts\Frontend\contourform.js
Down around line 36, fiddle with this (Date format options are here)
$(".datepickerfield").datepicker({ dateFormat: 'd MM yy' });
Hope that helps.
N
Hi Nathan,
thanks for your suggestion, however i think that your amned is for contour and not the new Umbraco Forms, the code layout for Umbraco forms seems ot be similar ,there is now a umbraco.forms.js file but I cant find where the date picker is instansiated.
Best
L
Okay further looking has found that pikaday tried to use moment.js if it is available, for whatever reason though moment.js was not being output on the page. If i do output moment.js on the page then the default format string defined inpickaday is used, If i change this format string then the string displayed in the date field is altered, however if i try and make it fancy for example "Thursday, 15th April 2015" then the value is not saved in Umbraco.
I think for my case this is a would like to have requriment so I am not going ot persue it any further.
L
Post failure, please ignore
is working on a reply...