Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1444 posts 1855 karma points
    Jun 26, 2017 @ 15:09
    Gordon Saxby
    0

    Date string in text field being reformatted

    I have a textstring field and want to store a formatted date in it - e.g.

    2017-07-01T12:30:45
    

    However, when I save the node it gets reformatted to

    01/07/2017 12:30:45
    

    Why is that happening? I have tried it on 3 different websites (v7.4.2 and v7.5.6 and v7.5.11).

    It also happens in a textarea if there is no other text. It woks OK if the field is populated in code (controller / c#).

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jun 26, 2017 @ 15:35
    Nicholas Westby
    0

    I have seen similar in the past, such as with this bug relating to JSON in text fields: http://issues.umbraco.org/issue/U4-7382

    This seems like an Umbraco bug, so I'd recommend submitting a bug report. As to how this bug is occurring, I have some ideas:

    Not really sure. Your best bet is the submit a bug report. I can give you some ideas if you are looking for workarounds.

  • Gordon Saxby 1444 posts 1855 karma points
    Jun 26, 2017 @ 15:40
    Gordon Saxby
    0

    Hi Nicholas,

    I have submitted it as a bug - http://issues.umbraco.org/issue/U4-10067

    In general, for this application, it will (should) be OK as the date is only ever populated in code. Of course, during testing I want to be able to edit it manually!

    I am sure there are workarounds but really it shouldn't be happening at at all - if I type something into a field, I want it to stay like that!

    If it looks like it won't be possible to / easy to fix, I will try changing the field to a label so that it can't be edited. However, that will cause trouble - I just know it will!!

Please Sign in or register to post replies

Write your reply to:

Draft