I am trying to fix an issue on an old react application and I am not familiar with the approach used here. We are using the following dependencies(some important ones mentioned). Node version is 14.x
"dependencies": { "@progress/kendo-ui": "^2021.3.1207", "@types/node": "^12.20.15", "@types/react": "^17.0.11", "moment": "^2.29.4", "react": "^17.0.2", . . . } "devDependencies": { "@types/jquery": "^3.5.5", . . . }
Right now we are using the below timepicker and this passes in a datetime value on save, in this format 2024-03-14T09:00:00.000Z. But I want to change this to pass in value as a time in this format HH:mm:ss .
<input
id={this.id}
name={this.props.validationName}
data-role="timepicker"
data-bind={`value: ${ValueCodes.Start}`}
data-format="h:mm tt"
required={true}
disabled={true}
/>
export class ValueCodes { public static readonly Start = 'sTRT_TIME'; . . . } protected getDataSourceOptions() { const fields: { [key: string]: { type: string } } = {}; switch (this.categoryCode) { case 'INIT': fields[ValueCodes.Start] = { type: 'date' }; . . . break; . . . default: break; } return { fields: fields, transportOptions: { baseUrl: `${X.getApiUrl()}value/${this.categoryCode}` } }; } }
On changing the 'type' from 'date' to 'time' here, fields[ValueCodes.Start] = { type: 'date' }; I encountered some errors. I was only able to save the value in my desired format, if I disable validation. Aprart from that the timepicker now will not load the datetime or time value fetched from the backend because of the 'type' change from 'date' to 'time'.
Is there a specific way in kendo that I can try to overcome this?