Skip to content

cannot retrieve time (hours/minutes) #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fanalion opened this issue Jan 20, 2011 · 4 comments
Open

cannot retrieve time (hours/minutes) #89

fanalion opened this issue Jan 20, 2011 · 4 comments

Comments

@fanalion
Copy link

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

@miljan-aleksic
Copy link

I would also like to see a getTime feature. Maybe should return todays date+the specified hour so you can create new Date object and threat further.

By the way this addon should be in UI core, it's just great :)

@ejazrasool
Copy link
Contributor

I would also like to see this implemented. It is very disappointing that a Datetime picker hasn't been developed into the core of jQuery UI.

May be I'll invest some time add add this feature. I'll post back here with progress if I go that way.

I'm not acquainted with how to contribute features on github so will need help.

Thanks.

@ejazrasool
Copy link
Contributor

Ok. I've created a pull request (#859).

The repo's contribution guide says to always fork the dev branch so did I. But now I see that the dev branch is way behind the master branch in terms of commits. Does that mean that everybody has been merging the master branch? Should I too?

@trentrichardson
Copy link
Owner

dev branch is where you should send it. It has latest code (I pushed to it
earlier today)
On Jan 18, 2016 8:43 PM, "ejazrasool" notifications@github.com wrote:

Ok. I've created a pull request (#859
#859).

The repo's contribution guide says to always fork the dev branch so did I.
But now I see that the dev branch is way behind the master branch in
terms of commits. Does that mean that everybody has been merging the master
branch? Should I too?


Reply to this email directly or view it on GitHub
#89 (comment)
.

trentrichardson added a commit that referenced this issue Jan 19, 2016
Issue #89 Fix: getDate() returns time (hh:mm) even when plugin is applied on "non-input" elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants