Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
How to bind string date to IGXDatetime picker
posted

hello,

i have a gird with one column as  date type with editable enabled.every thing is fine but problem occures when i bind the grid to the data from webapi, as from back end i m passing date in yyyy-mm-dd format and after binding  no date is visible on grid and i m unable to select date 

following error msg occurs,

ERROR TypeError: value.toLocaleDateString is not a function
at IgxDatePickerComponent.push../node_modules/igniteui-angular/fesm5/igniteui-angular.js.IgxDatePickerComponent._setLocaleToDate (igniteui-angular.js:23410)
at IgxDatePickerComponent.push../node_modules/igniteui-angular/fesm5/igniteui-angular.js.IgxDatePickerComponent._customFormatChecker (igniteui-angular.js:23425)
at IgxDatePickerComponent.get [as displayData] (igniteui-angular.js:23120)
at Object.eval [as updateDirectives] (IgxDatePickerComponent.ngfactory.js:102)
at Object.updateDirectives (core.js:10806)
at checkAndUpdateView (core.js:10459)
at callViewAction (core.js:10700)
at execComponentViewsAction (core.js:10642)
at checkAndUpdateView (core.js:10465)
at callViewAction (core.js:10700)

plzzz help.

  • 16310
    Offline posted

    Hi Alok,

    You need to pass a real date object to the component. It will not parse any string values. The same applies for the igxGrid. Please let me know if you have further questions.