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.

Datetimepicker plugin

See original GitHub issue

I tried a simple test with the following filter, when attempting to getRule, it throws an error that the input is NULL.

$('#builder-widgets').queryBuilder({
  plugins: ['bt-tooltip-errors'],
  filters: [{
    id: 'date',
    label: 'datetimepicker',
    type: 'datetime',
    plugin: 'datetimepicker',
    plugin_config: {
    }
  }]
});

Not sure why the input would return an empty value (https://eonasdan.github.io/bootstrap-datetimepicker/). No error thrown in console.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
mistic100commented, Apr 21, 2017

But you don’t need it anymore, the doc says to use input_event: 'dp.change'

5reactions
mistic100commented, Oct 8, 2015

The problem is that the author of the library decided to not fire the standard “change” event on the input when the datepicker is closed, thus QueryBuilder can’t be updated.

You need to manually trigger the “change” event when the date picker is updated (see DP doc about events).

$('#builder-widgets').on('afterCreateRuleInput.queryBuilder', function(e, rule) {
    if (rule.filter.id === 'date') {
      var $input = rule.$el.find('.rule-value-container [name*=_value_]');
      $input.on('dp.change', function() {
          $input.trigger('change');
      });
    }
});

In a next version I’ll provide a way to teach QueryBuilder which events to listen to

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Best Date And Time Picker JavaScript Plugins (2022 Update)
datetimepicker is a jQuery plugin that popups a simple and clean date & time picker interface when an input field on focus.
Read more >
DateTimePicker - XDSoft.net
DateTimePicker jQuery plugin select date and time. Use this plugin to unobtrusively add a datetimepicker, datepicker or timepicker dropdown to your forms.
Read more >
jQuery Date and Time picker
search. Search jQuery Plugin Registry. jQuery Date and Time picker. by Chupurnov Valeriy. jQuery plugin for date, time, or datetime manipulation in form ......
Read more >
xdan/datetimepicker: jQuery Plugin Date and Time Picker
datetimepicker · DatePicker · TimePicker · Options to highlight individual dates or periods · JS Build help. Requires Node and NPM Download and...
Read more >
24 jQuery Date And Time Pickers - Free Frontend
DateTime Picker is a quick highly customizable jQuery plugin. The design is clutter free & well suited for embedding it into mobile application ......
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