Foros de discusión

Calendar popup with readonly dates and multiple dates selected

thumbnail
Raja Seth, modificado hace 8 años.

Calendar popup with readonly dates and multiple dates selected

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Hi Team,

I am trying to achieve functionality somewhat similar to datepicker. What exactly I want to do is on click it should show a calendar popup and multiple dates (for example if have dates 09/04/2015 and 09/08/2015) it should show highlighted dated between the range given. Is it possible through liferay date picker?

Please let me know if anyone have came across such functionality. I have tried with normal jquery but didn't able to achieve through it. If any solution with jquery also please share.

Thanks & Regards,
Raja
thumbnail
Raja Seth, modificado hace 8 años.

RE: Calendar popup with readonly dates and multiple dates selected

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Please let me know if anyone came across such scenario.
thumbnail
Raja Seth, modificado hace 8 años.

RE: Calendar popup with readonly dates and multiple dates selected

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Hi,

I have implemented the logic the way given below but what's happening on my second click the calendar popop is coming.

function showCalendar(stDate, edDate, trigger) {
	
	var yasMDash = document.getElementById('yasMDash').value;
	var date1 = new Date(stDate);
	var date2 = new Date(edDate);
	
	var day = 1000*60*60*24;
	
	var dateRange = '';
	
	var diff = (date2.getTime()- date1.getTime())/day;
	for(var i=0;i<=diff; i++) {
		var xx = date1.getTime()+day*i;
		var yy = new Date(xx);
	
		dateRange = dateRange + (yy.getMonth()+1)+"/"+yy.getDate()+"/"+yy.getFullYear();
		if(i<diff) { daterange="dateRange" + ' yasmdash '; } document.getelementbyid('yasdatepic').value="dateRange;" aui().use('aui-datepicker', function(a) new a.datepicker({ trigger: '#yasdatepic', mask: '%m %d %y', changedate: true, calendar: selectionmode: 'multiple' }, popover: zindex: 1 panes: }); }< code></diff)>
<br><br>Can anyone suggest if I want to trigger aui-datepicker after my javascript method execution.<br><br>Regards,<br>Raja
thumbnail
Raja Seth, modificado hace 8 años.

RE: Calendar popup with readonly dates and multiple dates selected

Regular Member Mensajes: 233 Fecha de incorporación: 18/08/11 Mensajes recientes
Finally I had to write the logic for each record I need to create script and function. I didn't found any other way to implement such logic.