Format the Date and Time of a Form Calendar Input

Mike Bilz asked on August 8, 2017 01:50

Hello Kentico Team,

I have a form which uses the Calendar form builder tool. When the user selects a date the input gets filled out with the simplified date "8/8/2017". I would prefer that the input be returned as "Tuesday, August 8, 2017".

Is it possible for me to set the formatting of the date that appears in the input? I didn't see anything in the Form Builder or Fields tab that allowed for formatting code or macros.

Any assistance would be greatly appreciated. Thanks.


Recent Answers

Trevor Fayas answered on August 8, 2017 15:40

The default Kentico Calendar does not have the ability to set the returned input. Here are your options:

  1. Set the form control to Textbox instead of Calendar, then on the form itself utilize your own Date picker jQuery module, there are many out there that you can control the displayed value (like Bootstrap DatePicker), just be sure that the displayed value can be DateTime.Parse() properly into a date time if the field is going to be of type Date/DateTime
  2. Create your own form control that acts as you wish, sadly the existing Calendar form control itself does not have any options within the control to alter the rendering.

I suggest option #1!

0 votesVote for this answer Mark as a Correct answer

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