Telerik Forums
Kendo UI for Angular Forum
0 answers
1 view

 

Hi.

I'm trying to clear data in a control if the user has entered an incomplete date. My ControlValueAccessor, which wraps a DateTimePicker, implements the following logic.
If the control contains a {incompleteDate: true} error and the input field loses focus, patchValue(null) is executed. However, the control still contains the error {incompleteDate: true}

 

I think not correct check in this line (libs/dateinputs/src/dateinput/dateinput.component.ts)

this.isDateIncomplete = this.kendoDateObject.hasValue() && this.value === null;

full method

    private updateIncompleteValidationStatus(): void {
        const previousValue = this.isDateIncomplete;
        this.isDateIncomplete = this.kendoDateObject.hasValue() && this.value === null;  // Not correct check

        if (previousValue === this.isDateIncomplete || !this.incompleteDateValidation) { return; }

        if (isPresent(this.ngControl) && !isPresent(this.pickerService)) {
            this.cdr.markForCheck();
            this.ngZone.run(() => this.onValidatorChange());
        } else if (isPresent(this.pickerService)) {
            this.pickerService.dateCompletenessChange.emit();
        }
    }

Installed packages

"@progress/kendo-angular-dateinputs": "15.4.0",
"@angular/core": "^16.2.12",
 

Live demo

https://stackblitz.com/edit/angular-czvcsm-zrtsrw?file=src%2Fapp%2Fdate-picker%2Fdate-picker.component.html

Thanks for help.

 

Andrii
Top achievements
Rank 1
 updated question on 26 Apr 2024
1 answer
86 views
My users will enter a date and time in UTC and this data will be stored in a form. However, the component uses local time instead of UTC.

If the user enters  2023-08-09 15:00:00, I want it to be save as 2023-08-09T15:00:00.
Yanmario
Telerik team
 answered on 14 Aug 2023
1 answer
53 views
Is there a way to have these controls always displayed rather than having them associated with a textbox and click?
Hetali
Telerik team
 answered on 20 May 2023
1 answer
68 views

I have been trying to create something in the style below. But the event never seems to fire when I select a date. Help  ? 

 

 

  //  validators: [this.sessionStartEndLogic()],
               

//  updateOn: 'change'

 

 

Martin
Telerik team
 answered on 03 Nov 2022
0 answers
75 views
I have both date-picker and date-time-picker on the screen, but when screen is small such as mobile devices and picker is bigger than working area it goes out of the screen without any scroll. but date-picker works fine it detect there is not enough space in bottom and it opens of top the input.
I've attached two screenshots which describes the problem.
daniel derakhshani
Top achievements
Rank 1
 asked on 04 Jul 2022
1 answer
45 views

I am using Kendo-datetimepicker in my Angular app. In my Reactive form i set the intial value as null for FormControlName. When i close the component without updating any value. It shows the following error. Please someone guide me through this. Thanks in Advance.

 

ERROR TypeError: Cannot read properties of null (reading 'isEmpty')
    at DateTimePickerComponent.isEmpty (index.js:8605:53)
    at FloatingLabelComponent.updateState (index.js:463:44)
    at Object.updateState [as next] (index.js:535:40)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:183:1)
    at SafeSubscriber.next (Subscriber.js:122:1)
    at Subscriber._next (Subscriber.js:72:1)
    at Subscriber.next (Subscriber.js:49:1)
    at EventEmitter_.next (Subject.js:39:1)
    at EventEmitter_.emit (core.mjs:22416:15)
    at FormControl.updateValueAndValidity (forms.mjs:2514:31)
Martin
Telerik team
 answered on 17 Jun 2022
4 answers
112 views

Hello,

In our application, we offer the users possibility to customize settings and save them inside MongoDB, and some of those settings are of DateTime/Time type. 

The problem is, that when the user sets a time inside the DateTime Picker (let's say 17 April 2020, 23:59), the value saved inside MongoDB is the serialized one, 2020-04-17T20:59:00.000Z  (I write the ngModel in console and I get Fri Apr 17 2020 23:59:00 GMT+0300 (Eastern European Summer Time), so the serialization is correct considering the time zone, but we need to save in database the exact date the users sets inside the DateTimePicker.

console.log(this.dateModel, JSON.stringify(this.dateModel)) writes
Fri Apr 17 2020 00:00:00 GMT+0300 (Eastern European Summer Time)
'"2020-04-16T21:00:00.000Z"'

What can be done so the DateTimePicker shows the date with the same time as when it is serialized?

PS. We have same functionality in an older application made with AngularJS, but there is no problem because the Date Picker for jQuery UI accepts strings as ng-model.

 

Thanks,

Iuliana

Iuliana Maria
Top achievements
Rank 1
Iron
 updated answer on 10 Jun 2022
1 answer
37 views

This is regarding the screen reader issues that kendo-datepicker faces only on chrome.

the screen reader was able to read the whole date that has been selected in the date picker because we added a property called title.

Further tabbing to change day/month/year individually causes the screen reader to just read "selected" or "unselected" which doesn't make much sense.

 

Could you please suggest a resolution for this one?

Yanmario
Telerik team
 answered on 15 Mar 2022
1 answer
53 views

I have a kendo component kendo-datetimepicker (angular project)

When I open the calendar, start typing the date (day, month, year) and time (hours, minutes) in the input, right at the end when I select minutes - the calendar closes automatically.

The issue could be checked here: https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/date-time-limits/

Any way to prevent the calendar from closing when I type the date manually?

And close, only when I click on the cancel or set button or somewhere outside?

Here is a video with the issue: https://vimeo.com/662234988

Yanmario
Telerik team
 answered on 07 Jan 2022
1 answer
43 views

Hi,

I was wondering if it is possible to default the AM/PM designator programmatically, without having to set an actual time value to the time picker?

The min property does work, however it does not seem to synchronise with the AM/PM designator on the actual input field.

For example, if I've set the min to be 1:00PM, then the list actually does not have the AM available - which is correct. However, the input field still has "hh:mm am" displaying.

I suppose one other way could be to change the dayPeriod placeholder text from AM to PM, if that is at all possible using the currently existing API.

Martin
Telerik team
 answered on 23 Nov 2021
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?