Skip to content

startdt.getTime not a function for timeRange #872

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
jmzbond opened this issue Mar 24, 2016 · 5 comments
Open

startdt.getTime not a function for timeRange #872

jmzbond opened this issue Mar 24, 2016 · 5 comments

Comments

@jmzbond
Copy link

jmzbond commented Mar 24, 2016

Just downloaded latest JS (11/2015), plopped in exactly the example code as given:

var startTimeTextBox = $('#deliverytime_start');
var endTimeTextBox = $('#deliverytime_end');

$.timepicker.timeRange(
  startTimeTextBox,
  endTimeTextBox,
  {
    minInterval: (1000*60*60), // 1hr
    timeFormat: 'HH:mm',
    start: {}, // start picker options
    end: {} // end picker options
  }
);

Upon page load, getting this error:
Uncaught TypeError: startdt.getTime is not a function

Has this happened to anyone else?

@trentrichardson
Copy link
Owner

Try the example as is in the documentation on the Examples tab, Time Ranges
section, it is working there:

http://trentrichardson.com/examples/timepicker/

On Wed, Sep 14, 2016 at 2:58 PM, Angelo Riganis notifications@github.com
wrote:

Same here...


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#872 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATHOAUhvPDJeH7mONpSppG1soxzvKu9ks5qqEPRgaJpZM4H3lur
.

Thanks,

Trent Richardson

trentdrichardson@gmail.com

trentrichardson.com

@melbreaker
Copy link

melbreaker commented Feb 13, 2018

This also happened to me. The workaround is to check if startdt.getTime function exist at checkDates function in jquery-ui-timepicker-addon.js.

if (startdt !== null && typeof startdt.getTime !== "undefined")

@semmelbroesel
Copy link

I have the same issue.

The workaround removes the error but also the functionality, so that is not a solution for me.

My code is virtually identical to that of the example page.

	var startBox = $dialog.find('timerangepickerstart').first();
	var endBox = $dialog.find('timerangepickerend').first();
				
	$.timepicker.timeRange(
		startBox,
		endBox,
		{
			minInterval: (1000*60*15),  // 15 minutes
			timeFormat: 'HH:mm',
			start: {},
			end: {}
		}
	);

I am running this on Bootstrap - would that make a difference?

Any ideas on how to fix this?

Thanks!

@semmelbroesel
Copy link

I figured it out - sorry, this was my fault. I thought "first()" would return just the first occurrence of the item in question, but apparently it returns much more that causes issues here.

As soon as I changed the startBox/endBox declaration to use ids instead of classes, it worked (using the workaround mentioned earlier).

@saniyasaher20
Copy link

Just downloaded latest JS (11/2015), plopped in exactly the example code as given:

var startTimeTextBox = $('#deliverytime_start');
var endTimeTextBox = $('#deliverytime_end');

$.timepicker.timeRange(
  startTimeTextBox,
  endTimeTextBox,
  {
    minInterval: (1000*60*60), // 1hr
    timeFormat: 'HH:mm',
    start: {}, // start picker options
    end: {} // end picker options
  }
);

Upon page load, getting this error:
Uncaught TypeError: startdt.getTime is not a function

Has this happened to anyone else?

I followed all steps written in docs but still date time range is not working. I am getting the same error in my console. Uncaught TypeError: startdt.getTime is not a function. Please help

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

5 participants