Bootstrap DatePicker editor field plugin fix

Bootstrap DatePicker editor field plugin fix

ACL TechnologyACL Technology Posts: 5Questions: 2Answers: 0
edited January 2017 in Free community support

Plugin fails, when i try to edit row where column with date is null.
Function fails on val.getMonth (null passes typeof val === 'object' check).

It can be fixed by improving set function.
From:

if ( typeof val === 'object' && val.getMonth ) {
    conf._input.val( val ).datepicker('setDate', val);
}

To:

if ( typeof val === 'object' && val && val.getMonth ) {
    conf._input.val( val ).datepicker('setDate', val);
}

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Sounds good to me - many thanks for this! It will be in the next site update.

    Regards,
    Allan

This discussion has been closed.