Skip to Content

Invalid date/time

Hi Experts,

I working with smart forms and smart filter bar. I am using the below json data. When i execute, its throwing the error "invalid date/time".

[

{

"Risk": "Confidential emails",

"RiskCategory": "IT Security",

"RiskLevel": "Very High",

"RiskValidFrom": "2014-01-01T00:00:00",

"RiskValidTo": "2014-01-01T00:00:00",

"Process": "IT",

"SubProcess": "NOC",

"Product_Service": "Advisory",

"LineofBusiness": "Investment Bank",

"RiskOwner": "James Smith"

},

{

"Risk": "Credit Card Data Leakage",

"RiskCategory": "IT Security",

"RiskLevel": "Very High",

"RiskValidFrom": "2014-01-01T00:00:00",

"RiskValidTo": "2014-01-01T00:00:00",

"Process": "Sales",

"SubProcess": "Customer Solutions",

"Product_Service": "Advisory",

"LineofBusiness": "Investment Bank",

"RiskOwner": "Ruan Jones"

}

]

Please help me to resolve this.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 10, 2016 at 12:26 PM

    Hi Gowtham,

    What is the data type of Date field in the OData Service? Ideally it should be Edm.DateTime. For such data types you need to pass date as Date Object. Use as below and it should work.


    "RiskValidFrom": "/Date(1449039257586)/"


    Here, I have given the date in milliseconds. You can get human readable date by using -

    new Date(1449039257586).


    BR.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 10, 2016 at 10:13 AM

    does the rest of the data displayed properly ?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2016 at 12:06 PM

    can you remove the time? and have a short date? if not.. you may need to change your string into a date type, such as new Date() or new Date(<whatever date you need>)

    Add comment
    10|10000 characters needed characters exceeded