Announcement

Collapse
No announcement yet.

[CLOSED] [#844] [1.11] Nullable DateTime.ToString() is not being formatted properly

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#844] [1.11] Nullable DateTime.ToString() is not being formatted properly

    When calling the ToString function on a Nullable DateTime object Bridge.Date.Format is not called resulting in an unexpected format. For example the following code:

    DateTime? test = DateTime.Now;
    Global.Alert(test.ToString());
    Produces a string like:
    Wed Jan 20 2016 17:24:55 GMT-0500 (Eastern Standard Time)
    Instead of like:
    1/20/2016 5:24:55 PM

    #2
    Hi danw,

    In JavaScript when you call .toString() on a Date object, the browser decides what the string format. I believe what you are seeing is the expected behaviour.

    Comment


      #3
      Okay, maybe this is a defect. We are investigating.

      Comment


        #4
        I don't think that's correct, if the code were as follows:

        DateTime test = DateTime.Now
        Global.Alert(test.ToString());
        The output would be as expected:
        1/20/2016 5:24:55 PM
        Based on the Bridge.NET DateTime class, I would expect Bridge.Date.Format to be used to format the Date object:
        [Template("Bridge.Date.format({this})")]
        public override string ToString()
        {
        return null;
        }

        Comment


          #5
          Git issue: https://github.com/bridgedotnet/Bridge/issues/844

          Comment


            #6
            The issue has been fixed in 1.11 release.

            Comment

            Working...
            X