cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid date/time

GowthamRaja
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185414
Active Contributor
0 Kudos

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.

GowthamRaja
Participant
0 Kudos

I have changed the date format as u suggested, its working fine . Thanks a lot

former_member185414
Active Contributor
0 Kudos

Welcome, Please close this thread.

Answers (2)

Answers (2)

SergioG_TX
Active Contributor
0 Kudos

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>)

jmargieh
Explorer
0 Kudos

does the rest of the data displayed properly ?