Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
RathnaDevi Chellaiah
How to get the no. of days between startdate and end date in aui calendar?
April 28, 2012 5:53 AM
Answer

RathnaDevi Chellaiah

Rank: Junior Member

Posts: 29

Join Date: March 26, 2012

Recent Posts

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();
});
Hitoshi Ozawa
RE: How to get the no. of days between startdate and end date in aui calend
April 28, 2012 7:03 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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;
RathnaDevi Chellaiah
RE: How to get the no. of days between startdate and end date in aui calend
May 3, 2012 1:23 AM
Answer

RathnaDevi Chellaiah

Rank: Junior Member

Posts: 29

Join Date: March 26, 2012

Recent Posts

Hi Hitoshi Ozawa,
Thanks for replying. it worked fine...
Hitoshi Ozawa
RE: How to get the no. of days between startdate and end date in aui calend
May 3, 2012 1:28 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

Good. I wasn't too sure that was what you wanted. emoticon