Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-35041

Date property not working in FlexJS

    XMLWordPrintableJSON

Details

    Description

      Below code throw error in conversion from MXML to JS.This code works fine in swf.

      var newDate:Date = new Date(Number(_xmlString.substr(0, 4)), Number(_xmlString.substr(4, 2)), Number(_xmlString.substr(6, 2)));
      var split:Array = _xmlString.split(" ");
      if (split.length > 1)

      { newDate.date = Number(split[1].substr(0, 2)); newDate.minutes = Number(split[1].substr(2, 2)); newDate.seconds = Number(split[1].substr(4, 2)); }

      And the error i am getting is

      Access of possibly undefined property date.
      newDate.date = Number(split[1].substr(0, 2));
      ^

      Access of possibly undefined property minutes.
      newDate.minutes = Number(split[1].substr(2, 2));
      ^

      Access of possibly undefined property seconds.
      newDate.seconds = Number(split[1].substr(4, 2));
      ^

      Attachments

        Activity

          People

            aharui Alex Harui
            kinjalpatel Kinjal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: