This is a migrated thread and some comments may be shown as answers.

Display value on particular date in a month

1 Answer 103 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Anup
Top achievements
Rank 1
Anup asked on 01 Aug 2012, 10:21 AM
I want to display data on particular dates, i have two array which contains some dates, if my current date matches with tht array date then i want to shoe some value from tht array.
I tried to use each loop on that array on content of calendar but its giving runtime error called Invalid Template.....Any Suggestions????

I have two array which are Two dimensional,

 

populateCalendar:

 

function (Holiday) { 

var  holidaydateList = []

//constructing holidaydatelist array from Holiday object...
$.each(Holiday, function (index, model) { 
var day = model.HolidayDate.toString();  
holidaydateList.push({ HolidayDate: day.substring(6, day.length - 2), HolidayData: model.HolidayName });
});

$("#forecastCalendar").kendoCalendar({  
//value: today, 
month: {
// template for dates in month view 
content: 
'# jQuery.each([' + holidaydateList + '],function(index,item){ #'
'# if (item.HolidayDate == +data.date) { #'
'<div style="background-color: Aqua">item.HolidayData</div>'
'# } else { #'
'<div></div>'
'# } #'
'# }); #'
'#= data.value #' 
},
footer: 
"Today - #=kendo.toString(data, 'd') #" 

});

1 Answer, 1 is accepted

Sort by
0
Kumarasen
Top achievements
Rank 1
answered on 03 Aug 2012, 09:20 PM
Hi Friends,
To Display the Current date in text box,,,
Try the following code:

<script>
function addDate(){
date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var year = date.getFullYear();

if (document.getElementById('date').value == ''){
document.getElementById('date').value = day + '-' + month + '-' + year;
}
}
</script>
<body onload="addDate();">
Today's Date is: <input type="text" id="date">
</body>

Thanks 
Kumarasen
__________________________
[url=www.turbooven.biz]Turbo Oven[/url]
Tags
Calendar
Asked by
Anup
Top achievements
Rank 1
Answers by
Kumarasen
Top achievements
Rank 1
Share this question
or