0
How do I format a date for the Brazilian standard in Javascript? I looked in several places but I could not get the date to be displayed in the Brazilian standard.
Summary of the problem:
How the date is in the database:
2021-02-05 04:30:25
How I wanted the date to be displayed in Return:
05/02/2021 04:30:25
The part of the code that I need to do this is down here, in case anyone understands better:
{
"render": function ( data, type, row ) {
var dataCadastro = '2021-02-05 04:30:25'; // Formatar essa data para o padrão brasileiro > dd/mm/aaaa
return dataCadastro; // retorna a data definida acima
},
"targets": 1,
},
For this and other features I recommend using lib Moment.js
– tvdias
My project has the built-in Moment.js, but I have no idea how using heheh could help me? <script src=".. /all/plugins/Moment/Moment.min.js"></script>
– Lucas Martins Developer
See if the answer helps.
– tvdias