Calendar - Unexpected behaviour when date format contains whitespace characters and showTime is enabled #6521
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Current behavior
When the date format contains whitespace characters, changing the text in the input clears the value of the input. This happens only when "showTime" is true.
Expected behavior
The text won't be cleared if the date format contains whitespace characters.
Minimal reproduction of the problem with instructions
STEPS TO REPRODUCE
Pre-action: Set this format for p-calendar: M dd, y (Sep 19, 18) .
Actual result: The input is cleared.
I found the reason in your source code in calendar.ts#parseDateTime:
This is the point where you should modify the code:
let parts: string[] = text.split(' ');
In my case, parseDate method gets only 'Sep' in the first parameter (this.parseDate(parts[0], this.dateFormat)).
Angular version: 6.0.7
PrimeNG version: 6.0.0
The text was updated successfully, but these errors were encountered: