Try our conversational search powered by Generative AI!

Time picker field giving the 12:00 AM if we are not selected anything.


I have created the StartTime field by using the below code. Provided the required details, and not selected the StartTime field value then published the page. But on the publishing page startTime field value showing 12:00. How can we show empty/null if not select the StartTime.

[ClientEditor(ClientEditingClass = "dijit/form/TimeTextBox")]
        public virtual DateTime StartTime { get; set; }


<p>@Model.CurrentPage.EventEndTime.ToString("hh:mm tt")</p>

Sep 02, 2021 9:47

Try changing the type of the property to string

Sep 02, 2021 11:12

Have you tried using a nullable DateTime?

public virtual DateTime? StartTime { get; set; }
Sep 14, 2021 16:59
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.