Fórumok

How to get the no. of days between startdate and end date in aui calendar?

thumbnail
RathnaDevi Chellaiah, módosítva 11 év-val korábban

How to get the no. of days between startdate and end date in aui calendar?

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.03.27. Legújabb bejegyzések
Hi guys,
I am using aui calendar of liferay to display start date and end date.. i want to find the no of days between start and end date.. Does any one know how get the days between in aui calendar.. my calendar function is :


AUI().use('aui-datepicker', function(A) {
var simpleDatepicker1 = new A.DatePicker({
trigger : '#FromToDate',
calendar : {
dateFormat : '%d/%m/%y',
allowNone : false,
showToday : true,
setValue : true,
minDate : '01/01/1900',
maxDate : '01/01/2100',
selectMultipleDates : false
}
}).render();
});
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: How to get the no. of days between startdate and end date in aui calend

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Can't you just get values from your start date and end date and just calculate differences in your javascript function?

var startdate = new Date(startyear, startmonth - 1, startday);
var enddate = new Date(endyear, endmonth - 1, endday);
var diff = startdate - enddate;
var numberOfDays = diff / 86400000;
thumbnail
RathnaDevi Chellaiah, módosítva 11 év-val korábban

RE: How to get the no. of days between startdate and end date in aui calend

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.03.27. Legújabb bejegyzések
Hi Hitoshi Ozawa,
Thanks for replying. it worked fine...
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: How to get the no. of days between startdate and end date in aui calend

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Good. I wasn't too sure that was what you wanted. emoticon