UPDATE: Actually the problem is when the user clicks the date field, the value is changed to the current date time. How do I stop that?
Using TD v6.9.4Passing DateTime object from .Net MVC 6. The date and time show correctly, but when the user clicks on the date field, the picker opens and is set to 'AM' regardless.
$(".timepicker").each(function () { var elementId = $(this).attr("id"); new tempusDominus.TempusDominus(document.getElementById(elementId), { localization: { dateFormats: { LLL: 'MM/dd/yyyy h:mm T', }, format: 'LLL', }, display: { icons: { type: 'icons', today: 'bi bi-calendar-check', time: 'bi bi-clock', up: 'bi bi-arrow-up', down: 'bi bi-arrow-down', previous: 'bi bi-arrow-left', next: 'bi bi-arrow-right', clear: 'bi bi-trash-fill', close: 'bi bi-x' }, sideBySide: true, keepOpen: false, buttons: { today: true, clear: true, close: true }, components: { decades: true, clock: true, hours: true, minutes: true, }, inline: false, theme: 'light' } });});
After clicking:
Date object as it leaves the MVC Controller:
The value even shows correctly in chrome dev tools:
How to I get the AM/PM to read correctly?
I have tried changing the date format in the js code and I have tried passing the date as a formatted string using "DataFormatString" in my model, neither have helped.