Kendo Date Picker and Luxon: Special luxon-adapter for the Kendo DatePicker?

1 Answer 56 Views
DatePicker
Tobias
Top achievements
Rank 1
Tobias asked on 20 Oct 2024, 09:06 AM

Is it possible to bind the kendo angular date controls directly against a luxon date object?

I tried the following:

A direct binding results in a compile error:

    <kendo-label text="Luxon Date">
                <kendo-datepicker  [value]="luxonDate"
                  placeholder="Choose a date ..."
                ></kendo-datepicker>
              </kendo-label>

Error in src/app/app.component.ts (28:37)

Type 'DateTime' is missing the following properties from type 'Date': toDateString, toTimeString, toLocaleDateString, toLocaleTimeString, and 36 more.

 

A binding against a Javascript date, on the other hand, works

 <kendo-label text="JSDate">
                <kendo-datepicker  [value]="date"
                  placeholder="Choose a date ..."
                ></kendo-datepicker>
              </kendo-label>

 

Is there also a special adapter for the Kendo DatePicker like for Angular Material Date Components (@angular/material-luxon-adapter)?

1 Answer, 1 is accepted

Sort by
0
Zornitsa
Telerik team
answered on 23 Oct 2024, 10:50 AM

Hi Tobias,

Thank you for the details and code snippets provided.

Indeed, the Kendo UI for Angular components currently do not support handling luxon.js or moment.js values directly. In general, all date-related Kendo components work with valid JavaScript Date objects, and any further processing of the dates like converting them to one of the possible string formats for sending it to a server, storing it in a database, etc., is left in the hands of the developer to implement as per the application's requirements.

On that note, the good news is that there is a feature request in our Feedback Portal regarding introducing official support for moment.js:

Feel free to upvote the above-linked item since we periodically monitor the customer demand for the logged features and consider their future implementation based on the increasing public interest. You can also follow the feature request to stay notified of any updates on this matter.

I hope the provided information sheds some light on the matter. 

Regards,
Zornitsa
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DatePicker
Asked by
Tobias
Top achievements
Rank 1
Answers by
Zornitsa
Telerik team
Share this question
or