Hello,
I was experimenting with your library in order to replace my custom built components for DatePicker.
What I was expecting is inside a form if I have something like this:
<ejs-datepicker id="datepicker" action="@Model.NoviKlijent.DatumRodjenja" format="dd.MM.yyyy" placeholder="Enter date"></ejs-datepicker>
Displaying is working fine as you can see in attachment-1.png
but the issue with this is when I'm posting the form I'm getting wrong date parsed. Results are included in attachment2
I have also followed docs: https://ej2.syncfusion.com/aspnetcore/documentation/datepicker/globalization/
and I have included sr-Latn culture in a
public Startup(IConfiguration configuration)
{
Configuration = configuration;
var cultureInfo = new CultureInfo("sr");
cultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy";
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
} |
public class DatePicker
{
[Required(ErrorMessage = "Please enter the value")]
public DateTime? value { get; set; }
} |
Hello Berly,
Appreciate the feedback, I'll give it a try tomorrow and I'll let you know.
Hello Christopher,
Your approach does it. I thought I would get away without changing the culture, but I guess I will have to do it.
Thank you
Regards,
Milos