Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14637 closed bug (notabug)

datetimepicker onselect not working properly

Reported by: saamalam@… 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.

Change History (1)

comment:1 Changed 6 years ago by scottgonzalez

Resolution: notabug
Status: newclosed

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

Note: See TracTickets for help on using tickets.