Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid date range if I change dateRangeDatesDelimiter #29

Closed
pin8marian opened this issue Feb 17, 2020 · 5 comments
Closed

Invalid date range if I change dateRangeDatesDelimiter #29

pin8marian opened this issue Feb 17, 2020 · 5 comments

Comments

@pin8marian
Copy link

Hi.
I just want to start by saying you are doing an amazing job. Thank you.
I saw the following behavior:
The selected date range is not valid in case I add another delimiter.
Example:
myDpOptions: IAngularMyDpOptions = {
dateRange: true,
dateRangeDatesDelimiter: "#",
dateFormat: 'dd-mmm-yyyy',
}

and the picked date is 11-Feb-2020#21-Feb-2020 in isDateValid , the "#" it won't get into the delimiters variable, that means when it will call getNumberByValue(dateValue[2]) , dateValue[2] will be "2020#21" and will return year=0, day=0, month=0, which is invalid.

@kekeh
Copy link
Owner

kekeh commented Feb 17, 2020

Thank you @pin8marian

Instead of dateRangeDatesDelimiter: "#" try dateRangeDatesDelimiter: " # "

Or do you want to use value of it without spaces?

@pin8marian
Copy link
Author

Thank you @pin8marian

Instead of dateRangeDatesDelimiter: "#" try dateRangeDatesDelimiter: " # "

Or do you want to use value of it without spaces?

Well, even if I put " # " or "#" it will still get as invalid date because will take the empty space into date. Like this:
Ex of date: 11-Feb-2020 # 21-Feb-2020
dateValue[2] will be "2020 " (see the space after 2020)

@kekeh
Copy link
Owner

kekeh commented Feb 17, 2020

I have fixed this issue. Can you try version 0.4.1.

@kekeh kekeh closed this as completed Feb 17, 2020
@pin8marian
Copy link
Author

I have fixed this issue. Can you try version 0.4.1.

Do I need to upgrade to angular 9 version to use 0.4.1 version?

Thank you
M

@kekeh
Copy link
Owner

kekeh commented Feb 18, 2020

You can use this component if your Angular version is >= 7.2. Maybe also earlier Angular versions work. I have tested this component only Angular 7.2 onwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants