Skip to main content

Bug Tracker

Side navigation

#14637 closed bug (notabug)

Opened December 15, 2013 03:08PM UTC

Closed December 15, 2013 03:12PM UTC

datetimepicker onselect not working properly

Reported by: saamalam@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

'''Here's my code:'''

$('.datetime').datetimepicker({
		
		
		dateFormat: 'yy-mm-dd',
		timeFormat: 'h:m',
		
		onSelect: function() {	
		console.log($(this).datetimepicker('getDate'));				
		 var startDate  = $(this).datetimepicker('getDate');
		 
		 var endDate = new Date(parseFloat(startDate.setHours(startDate.getHours()+24)));
		 

       //Get the ending date datepart
       var endDateDatePart = endDate.getFullYear() + '-' + endDate.getMonth() + '-' + endDate.getDate() + " " + endDate.getHours() + ":" + endDate.getMinutes();
 
      
            $('.datetime-end').val(endDateDatePart);
     
			
		}
	});

When I select any date for the 1st time it output the current date rather than which I select. However upon double and more click on date it outputs the right date.

Here's I'm in trouble, why this acts normal on Double select of date.

Attachments (0)
Change History (1)

Changed December 15, 2013 03:12PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

This is the bug tracker for jQuery core. Please report this issue to the author of this plugin.