question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting startDate and endDate via data-attribute seems to be broken?

See original GitHub issue

If I try to set the startDate and the endDate via data-attribute of the input-field:

<input id="inputBirthDate" type="text" name="inputBirthDate" class="datepicker" data-provide="datepicker" data-date-startdate="-120y" data-date-enddate="-18y">

The values for startDate and endDate are ignored. Also data-date-endDate, data-date-startDate and data-endDate and data-startDate are ignored.

Invoking the Datepicker via JS: $('input#inputBirthDate').datepicker({ startDate: "-120y", endDate: "-18y" });

works perfectly. 😃

Is there a way to set startDate and endDate via data-attributes? Or any other way, besides invoking it via JS-Bindings?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
peternijssencommented, Feb 1, 2015

I believe data-date-start-date=“” works.

0reactions
morfeus5000commented, Oct 17, 2016

funciona si haces un $(‘#fecha1’).attr(‘data-start-date’,‘-120y’); $(‘#fecha2’).attr(‘data-end-date’,‘-18y’);

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting the value of daterangepicker bootstrap - Stack Overflow
daterangepicker startDate and endDate returns moment objects not Javascript ... Now if we configure to show the dates between a ' - ',...
Read more >
Options — bootstrap-datepicker documentation - Read the Docs
Most options can be provided via data-attributes. An option can be converted to a data-attribute by taking its name, replacing each uppercase letter...
Read more >
Editing dates and date ranges - Zendesk help
In Explore, you can view dates broken down by years, half-years, quarters, months, weeks, weekdays, and days. You can also view a complete ......
Read more >
Using data attributes - Learn web development | MDN
JavaScript access​​ To get a data attribute through the dataset object, get the property by the part of the attribute name after data-...
Read more >
Restrict data input by using validation rules - Microsoft Support
For example, a record with two date fields might require that values of one field always precede values of the other field (e.g.,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found