Skip to content

cannot retrieve time (hours/minutes) #89

@fanalion

Description

@fanalion

I tried the following code:

var periodInit = new Date();
periodInit.setHours(8, 30, 0, 0);
$("#periodentry").datetimepicker("setDate", periodInit);
var periodVal = $("#periodentry").datetimepicker("getDate");
console.debug(periodVal);

The selected time 08:30 is set correctly (3rd line) in the widget but I didn't succeed in getting the time value back from the field. The last line prints:
Thu Jan 20 2011 00:00:00 GMT+0100 {}
in the Firebug's console. Using periodVal.getHours() / periodVal.getMinutes() returns 0. I expect 8 and 30 respectively.

Here's how I initialize the timepicker:

$("#periodentry").timepicker({
    ampm: false,
    hourMin: 2,
    hourMax: 16,
    hourGrid: 2,
    minuteGrid: 15,
    stepMinute: 5,
});

Browser used:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)

Thanks,
PJ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions