Why I can't pass variable in daterangepicker?
daterangepicker on my website:
I'm trying to translate this datepicker to other languages. Due to this I created json files with translations(rang and datelink).
- startDate: moment(Elastic.periods[".second"].range["Purchase Date/Time"].gte, "YYYY-MM-DD"),
- endDate: moment(Elastic.periods[".second"].range["Purchase Date/Time"].lte, "YYYY-MM-DD"),
- ranges: rang,
- "locale": datelink
- }, cb1);
- cb1(start, end);
Doing this way causes error:
Rang and datelink are links to json files with languages and they are defined.
- jQuery.Deferred exception: rang is not defined ReferenceError: rang is not defined
Is it impossible to pass variable into datepicker or I have errors in my code?