Telerik Forums
UI for ASP.NET Core Forum
1 answer
64 views

In the latest release, 23.1.4, a Date time picker with the DateInput option set fails to be initialized with a jQuery error "s is not a constructor".

This occurs in my code and when using the example from the demo pages https://demos.telerik.com/aspnet-core/datepicker/basic-usage

TagHelper:

<kendo-datepicker name="monthpicker" date-input="true" format="MMMM yyyy" value="DateTime.Now" start="CalendarView.Year" depth="CalendarView.Year" name="monthpicker" style="width: 100%" title="monthpicker">
        </kendo-datepicker>

HtmlHelper:

@(Html.Kendo().DatePicker() .Name("monthpicker") .Start(CalendarView.Year) .Depth(CalendarView.Year) .Format("MMMM yyyy") .Value("November 2011") .DateInput() .HtmlAttributes(new { style = "width: 100%", title = "monthpicker" }) )

 

Both of the above fail to be initialized with the same error. JQuery version 3.3.1 is being used in this case.

Gordon

Mihaela
Telerik team
 answered on 31 Jul 2023
1 answer
273 views

Afternoon.

I have a MVC Grid with popup editing, created using an example posted on a previous question from me:

https://www.telerik.com/forums/grid-popup-editing-1551548

The popup edit only updates some of the fields in the grid.

I have a datetime field Dateinpost which is set when the record is created - it doesn't need to be updated.

I have set its format in the model:

        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        [DataType(DataType.DateTime)]
        public DateTime? Dateinpost { get; set; }

It doesn't need to appear on the popup template, but I have included it here so that you can see its value:

    <div class="k-edit-field">
        @Html.EditorFor(model => model.Dateinpost)
    </div>

When I update any of the values I get the following ModelState error in the Update action, and the value of Dateinpost in the model is null;

As you can see, the format of the date in AttemptedValue is not correct.

I could write a work around that would clear the ModelState error and not update that field, as it's not to be updated anyway, but it seems that shouldn't be necessary.  I've also tried using a date format of "dd/MM/yyyy HH:mm:ss" but that doesn't work either.

Kind regards,

Richard

Tsvetomir
Telerik team
 answered on 06 Apr 2022
0 answers
63 views

The user edits dates in a grid in D M Y format .. BUT when saved we see an error that indicates it is expecting M D Y format.

Please see attached files.

adamhughes
Top achievements
Rank 1
Iron
Veteran
 asked on 21 Mar 2022
0 answers
50 views
If a user types (keyboard input) a value into the time picker (e.g. 14:10:13) and then clicks away from the field the value resets to 00:00:00.

This behaviour is only observed on a form that has pulled in data (e.g. an Edit Page) with 'DateInput()' applied to the Time Picker.

If the form is empty (e.g. a Create Page) the user can type in a value without having it reset when clicking away from the field.

Can you advise how to fix this?

See Code below:

<div class="k-form-field"> @(Html.Kendo().TimePickerFor(model => model.Time)

.DateInput() .Format("HH:mm:ss") .Interval(15) .ToClientTemplate() ) </div>

Dru
Top achievements
Rank 1
 asked on 24 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?