Bootstrap Datepicker Plugin

Bootstrap Datepicker Plugin

Karl53Karl53 Posts: 72Questions: 29Answers: 0

I'm having a couple of problems with this plugin:

http://editor.datatables.net/plug-ins/field-type/editor.bootstrapDate

Using it in inline mode.

The field is initialized this way:

            {
                "name": "dtEventDate",
                "type": "date",
                "className": "eventDate",
                "opts": { showOn: 'focus', format: "mm/dd/yyyy", startDate: "01/01/1980", endDate: "12/31/2079"}
            },

(1) The first time the editor opens, the date is formatted this way (in edit view):

Sun Jun 01 2014 00:00:00 GMT-0400 (Eastern Daylight Time)

If I click out of the cell and then back in, the date is formatted this way:

02/01/2015

I always want the latter. How do I get that behavior?

(2) More importantly, I can only set the date using the calendar for the month that opens. When I select another month, the editor loses focus and the user is no longer in editor mode but the calendar is still open and at at new month. If I click a date to set the date will not change.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,775Questions: 1Answers: 10,112 Site admin
    Answer ✓

    The first time the editor opens, the date is formatted this way (in edit view):

    That looks like a Javascript new Date().toString(). Is the data you are using for the records in the format mm/dd/yyyy or something else?

    More importantly, I can only set the date using the calendar for the month that opens

    How odd! Can you link me to the page you are working on so I can take a look please?

    Thanks,
    Allan

  • Karl53Karl53 Posts: 72Questions: 29Answers: 0

    Item 1, I needed to initialize a date string and not just pass a date object.

    Item 2 required a patch to the DatePicker's plug in.

This discussion has been closed.