Why I can't pass variable in daterangepicker?
Hello!
I have
daterangepicker on my website:
- $('#first_range').daterangepicker({
- 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);
I'm trying to translate this datepicker to other languages. Due to this I created json files with translations(rang and datelink).
Doing this way causes error:
- jQuery.Deferred exception: rang is not defined ReferenceError: rang is not defined
Rang and datelink are links to json files with languages and they are defined.
Is it impossible to pass variable into datepicker or I have errors in my code?