Formatting specific dates

2 posts, 0 answers
  1. Joachim
    Joachim avatar
    7 posts
    Member since:
    Oct 2014

    Posted 09 Feb Link to this post

    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?

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 10 Feb Link to this post

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