Inplace Editor DateTime Format

Hi, 

I have looked at the documentation and just can't quite figure out how to achieve something. I am looking to have some inplace date time editors with a specific date format, "yyyy-MM-dd" but I have not been able to pin point how/where I need to configure so that on load the in place editor shows that format. I would also be looking to do the same when I go to my date picker  that it has the same format as well. Any guidance will pre appreciated


Jorge


1 Reply

VJ Vinitha Jeyakumar Syncfusion Team March 31, 2022 10:30 AM UTC

Hi Jorge,


Your requirement to give a specific date format to the date picker and date range picker controls can be achieved by specifying the format property in model. please check the code below,

Code snippet:
index.cshtml
<ejs-inplaceeditor id="date" type="Date" mode="Inline" value="ViewBag.dateValue" model="ViewBag.dateModelData">
                </ejs-inplaceeditor>
           
                <ejs-inplaceeditor id="dateTime" type="DateTime" mode="Inline" value="ViewBag.dateTimeValue"  model="ViewBag.dateModelData">
                </ejs-inplaceeditor>
HomeController.cs
public IActionResult Index()
        {
           ViewBag.dateModelData = new { placeholder = "Select date", format = "yyyy-MM-dd" };
           
            return View();
        }


Documentationhttps://ej2.syncfusion.com/aspnetcore/documentation/datetimepicker/date-time-format


Please refer the attached sample below,

Regards,
Vinitha

Attachment: CoreIPE_edb9f3c4.zip

Loader.
Up arrow icon