Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

EPiServer.Forms.Samples BUGs (time fields losing state and incorrect date format)



I would like to report some bugs that we have discovered on the latest version of EPiServer.Forms.Samples 4.2.0

Timepicker loses state with form steps

Steps to reproduce

  1. Create a new episerver form in the CMS
  2. Add a datetime form element, edit and set the type to "timepicker"
  3. Add a form step, and a publish button
  4. View the page and enter a time
  5. Click Next step, then click previous step
  6. Observe the time has been lost

I have dug into the code a bit and the reason for this is that in EPiServerFormsSamples.js on the below line, it now return only the time and not a dummy date and time as per the commented out code 
then when it stores it this line fails as it no longer parses as a date object 

Datepicker defauls to US format in the UK

The reason for that seems to be that "en-GB" is no longer defined in EPiServerFormsSamples.js 

Jul 11, 2023 10:13

Hi Ivan,

I believe the forms sample is only to provide a showcase of how to extend forms, it is not intended to be a solution as such.

If you think that this really needs resolving in the package on nuget then might be worth sending the bugs to support via email.

They will then asses if this is a bug and allocate a bug reference for you and update as necessary.

You could also create your own datatime picker implementation that doesn't rely on this package and have full control over the implementation.



Jul 11, 2023 13:55

Hi Paul,

I believe the "Samples" name is a bit confusing , but it seems to be the main package for all the built in form builder elements as that is where all the resources are being loaded from at runtime

For more see 
"Optimizely Forms is available as a NuGet package EPiServer.Forms. Installing this main package will also  automatically install dependent packages"... "Optimizely Forms comes with a number of predefined form elements, such as text boxes, multi-line text areas"

*Edit - I tried removing EPiServer.Form.Samples to see what happens. And I see it then only has the very basic form elements available i.e. no date picker. 

Edited, Jul 11, 2023 14:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.