Eric Baldwin
Eric Baldwin

Reputation: 3491

xdsoft's datetimepicker displaying incorrect time options

I am using xdsoft's datetimepicker plugin: http://xdsoft.net/jqplugins/datetimepicker/

I configured it using:

$('.eventEditDate').datetimepicker({
    format:'m/d/y @ h:m a',
    formatTime:'h:m a',
    allowTimes: ['12:00', '13:00', '15:00'],
    timepicker: true,
    lang: 'en'
});

However, when I click the input bar, I get '11:08' listed as the option three times. The number of options corresponds to the number of elements in allowTimes even if I add or remove them, but the time displayed is always '11:08'.

How do I fix this?

Edit: The source code for the datetimepicker is here: http://pastie.org/9445932. The class of the div with the time options is xdsoft_today which is used on lines 599 and 632

Upvotes: 0

Views: 3082

Answers (1)

Tomás Cot
Tomás Cot

Reputation: 1013

The working version is here:

<input class="eventStartDate newEventStart eventEditDate startTime eventEditMetaEntry" id="from_date" name="from_date" placeholder="Start date and time" readonly="readonly" type="text" value="08/03/2014 11:11 PM">

$('#from_date').datetimepicker({
    format:'m/d/y @ g:i A',
    formatTime: 'g:i A',
    allowTimes: ['12:00 PM', '13:00 PM', '15:00 PM'],
    timepicker: true,
    lang: 'en'
});

See jsFiddle

Note, this required switching to the libraries linked in the jsFiddle (under External Resources). This is/was the version of the plugin: jQuery DateTimePicker plugin v2.3.2

Upvotes: 1

Related Questions