Display value on particular date in a month

2 posts, 0 answers
  1. Anup
    Anup avatar
    6 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2012 Link to this post

    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') #" 

    });

  2. Kumarasen
    Kumarasen avatar
    3 posts
    Member since:
    Aug 2012

    Posted 03 Aug 2012 Link to this post

    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]
  3. Kendo UI is VS 2017 Ready
Back to Top