Change date format of recurrenceEnds field to dd/mm/yyy

2 posts, 0 answers
  1. Jason
    Jason avatar
    9 posts
    Member since:
    Oct 2015

    Posted 16 Dec 2015 Link to this post

    Hello,
    I'm using on Kendo ASP.Net MVC 2015.1.429.

    On Kendo Scheduler, when adding/editing an event if use Recurrence feature, End field always show date with format: mm/dd/yyyy. (using Chrome browser latest version)

     Is there any way or workaround to change date format to: dd/mm/yyyy? 

    Thanks,
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 18 Dec 2015 Link to this post

    Hello Jason,

    Setting the format of the RecurrenceEditor DatePicker is not supported out of the box and custom code would be required. Possible solution would be using custom editor template where to utilize the editor "Change" event where to manually set this format:

    <script>
        function onChange(e) {
            this._container.find(".k-recur-until[data-role]").data("kendoDatePicker").setOptions({
                format: "yyyy"
            });
        }
    </script>
    <div data-container-for="recurrenceRule" class="k-edit-field">
        @(Html.Kendo().RecurrenceEditorFor(model => model.RecurrenceRule)
              .Events(e => e.Change("onChange"))
            .HtmlAttributes(new { data_bind = "value:recurrenceRule" }))
    </div>

    Regards,
    Vladimir Iliev
    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