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

Vote:
 

Hi,

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 https://github.com/episerver/EPiServer.Forms.Samples/blob/6fe93edfeb5cebe46962ba4ad8e9b4d303d50c38/src/EPiServer.Forms.Samples/ClientResources/ViewMode/js/EPiServerFormsSamples.js#L468 
then when it stores it this line fails as it no longer parses as a date object
https://github.com/episerver/EPiServer.Forms.Samples/blob/6fe93edfeb5cebe46962ba4ad8e9b4d303d50c38/src/EPiServer.Forms.Samples/ClientResources/ViewMode/js/EPiServerFormsSamples.js#L186C62-L186C65 

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

https://github.com/episerver/EPiServer.Forms.Samples/blob/6fe93edfeb5cebe46962ba4ad8e9b4d303d50c38/src/EPiServer.Forms.Samples/ClientResources/ViewMode/js/EPiServerFormsSamples.js#L7 

#304986
Jul 11, 2023 10:13
Vote:
 

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.

Thanks

Paul

#304995
Jul 11, 2023 13:55
Vote:
 

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 https://docs.developers.optimizely.com/content-management-system/v1.2.0-forms/docs/forms 
"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. 

#304996
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.