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

Can't set date format with class property #117

Closed
igortas opened this issue Dec 3, 2018 · 0 comments
Closed

Can't set date format with class property #117

igortas opened this issue Dec 3, 2018 · 0 comments

Comments

@igortas
Copy link

igortas commented Dec 3, 2018

Hi,

When I try to set custom invalid dates on the calendar on ngOnChanges with the custom function isInvalidDate, the code does not work because the date format is set with class property.

this.dateFormat = 'DD/MM/YYYY';
...
...
...
this.daterangepickerOptions.settings.isInvalidDate = function(date) { const formatted = date.format(this.dateFormat); return ['25/11/2018'].indexOf(formatted) > -1; };

When I use this.format I'm getting 018-11-25T00:00:00+01:00
Otherwise if i use date.format('DD/MM/YYYY') then works as expected.

BR,

@igortas igortas closed this as completed Dec 3, 2018
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

1 participant