Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Milos 6 posts 97 karma points
    Apr 12, 2018 @ 06:45
    Milos
    0

    Umbraco forms field type datepicker returning: String was not recognized as a valid DateTime.

    Hi I need your help.

    I created a form from a database table. One of the fields is a date. I put the datepicker field type on that field and on submit it trows an exception "String was not recognized as a valid DateTime." i have checked and it has nothing to do with the data types in the db. I have tried changing CultureInfo, dateformats and a lot of other stuff but nothing seems to work. (Or i am not changing it in the right place.)

    Bonus question: i also need for that datepicker to only allow weekdays to be pick and days in the future. If i need to make a new FieldType just provide an example for datepicker cooding.

    Thank you!

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Apr 12, 2018 @ 12:00
    Dennis Aaen
    0

    Hi Milos and welcome to our.

    I am sorry to hear that you have issues with Umbraco forms field type datepicker returning: String was not recognized as a valid DateTime.

    I think that you have hit into this issue

    http://issues.umbraco.org/issue/CON-1368

    See Matthews comment and what worked for him. Can you modify the files too and see if it works for you too.

    Hope this helps,

    /Dennis

  • Viral Shah 32 posts 61 karma points
    May 09, 2018 @ 08:07
    Viral Shah
    0

    Hi

    I am running into similar issue where in getting this exception -

    --

    String was not recognized as a valid DateTime.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.FormatException: String was not recognized as a valid DateTime.


    I checked this below out but I don't have this - ~/Views/Partials/_ListFormFields.cshtml

    http://issues.umbraco.org/issue/CON-1368

    Can any one please help? Appreciate much.

    Kind regards,

    /Viral

  • Milos 6 posts 97 karma points
    May 24, 2018 @ 13:00
    Milos
    0

    Viral i did not find the solution on my problem using umbraco forms. I solved the problem by creating a user control and importing it as a macro inside one of my templates, and with the user control everything works fine.

Please Sign in or register to post replies

Write your reply to:

Draft