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

Formatting specific dates

1 Answer 51 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Joachim
Top achievements
Rank 1
Joachim asked on 09 Feb 2016, 12:28 PM

Hi,

 I'm looking for a way to put a list of dates in bold and /or alter their background color. I'll receive a list in the model sent to this view, in the example below I just simulate the model I'll be expecting.

 

@{ var datesTest = new DateTime[]{new DateTime(2016, 2, 1),

                                                           new DateTime(2016, 2, 2),

                                                           new DateTime(2016, 2, 3),

                                                           new DateTime(2016, 2, 4),

                                                           new DateTime(2016, 2, 5)};
}

@(Html.Kendo().DatePicker()
                  .Name("datepicker")
                  .Culture("en-GB")
                  .Format("dd/MM/yyyy")
                  .Value(DateTime.Now)
                  .Max(DateTime.Today)
            )

 

Can this easily be done?

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 10 Feb 2016, 10:38 AM
Hello Joachim,

I would suggest you check our Templates online demo: It shows how to use a custom cell template in order to modify the rendered value.

In your case, you will need to serialize the list dates, producing a list of JavaScript Date objects similar to the birthdays collection.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Calendar
Asked by
Joachim
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or