Display formats for cms:DateTimePicker

Arshad Nazeer asked on October 13, 2014 10:55

I am using following line of code in my page: <cms:DateTimePicker runat="server" ID="EventStartDate" CssClass="event-start-date" DisplayNow="false" EditTime="false" data-toggle="tooltip" data-placement="right"/>. I want to display date in the following format: Monday, October 13, 2014. To do this I changed the following line of code: string datePattern = info.ShortDatePattern.Replace("yyyy", "yy").Replace("'", ""); (Line Number: 53, File Name: ModalCalendar.ascx.cs) to string datePattern = info.RFC1123Pattern; but I am getting a following error message: SyntaxError: missing } after property list. So, then, I changed string datePattern = info.RFC1123Pattern; to string datePattern = "ddd, dd MMM yyyy"; Now, when I choose October 13, 2014 from Calendar the following is displayed: 1313, 13 1010 20142014. But I want to display date as 'Monday, October 13, 2014'. How to do this?

Recent Answers

Juraj Ondrus answered on December 6, 2014 11:15

Hi Arshad,

Date Picker is using the jQuery library. The date format is determined by CultureCode. Could you please send us a full stack trace of the error? Are you using Calendar control with that picker? If so, custom datetime format in our calendar control is not supported scenario. The modification should be feasible in CalendarControl.ascx.cs form control. Here you should modify timePicker.DateTimeTextBox.Text to return desired format. If you decide to do this, the best practice is to make a copy of our control and do all modifications there to prevent future problems with upgrades or hotfixes.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.