Skip to content
Advertisement

Tempus dominus: decoupling the rendered date format from the actual value sent upon form submission

I’m using Tempus Dominus bootstrap-4 version 5.39.0. I can configure the displayed time format in this way:

$('.datePicker').datetimepicker({
    format: 'DD/MM/YYYY',
    locale: 'en'
})

But this sends to server dates in the format: 'DD/MM/YYYY' while it consumes dates in format 'YYYY-MM-DD'. Is there a way to decouple the value displayed in the form from the one sent to server upon submission?

Advertisement

Answer

Looks like there is no way to do it out-of-the-box. The only way is tweaking dates format (e.g., with momentjs) before submitting data.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement