Why does not it bring the data to the datetime-local type impu?

0

I am passing data from a record to some inputs when I click on one of the events, so that they are displayed on the screen, however, it does not pass the data to the datetime-local type input. The fields in the data section are obviously datetime. I'll be attentive to the answers, thank you.

eventClick: function(event, jsEvent, view) {

$('#event_id').val(event.id);
$('#id_mot2').val(event.mot);
$('#nombre_estudiante').val(event.estudiante);
$('#jc2').val(event.jefe_c);
$('#rut_estudiante').val(event.rut_estudiante)
$('#start_f').val(moment(event.start).format('DD/MM/YYYY HH:mm'));
$('#end_f').val(moment(event.end).format('DD/MM/YYYY HH:mm'));
$('#modal_editar').modal();

},
    
asked by CristianOx21 26.10.2017 в 16:24
source

1 answer

2

The problem is that a input of type datetime-local requires a value with a certain format. Specifically, it requires that the date be formatted in RFC 3339 .

The format would be the following:

  

YYYY-MM-DDTHH: mm: ssTO

Where:

  • YYYY : 4-digit year
  • MM : 2-digit month
  • DD : 2 digit day
  • T : Separator between date and time. It's fixed.
  • HH : Time in 24 mode.
  • mm : Minutes with two digits
  • ss : Seconds with two digits
  • TO : Timezone , or time zone (Z or T)

A valid date would be for example:

  

2017-10-26T16: 35: 52Z

    
answered by 26.10.2017 / 16:36
source