JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<form>
  Copy Date:
  <input type="date" name="date1" value="2017-02-28" class="revert_date_to_text">
  <br><br>
  Paste Date:
  <input type="date" name="date2">
  <br><br><br><br>
  Copy Date/Time:
  <input type="datetime-local" name="date1" value="2015-03-30T21:58" class="revert_date_to_text">
  <br><br>
  Paste Date/Time:
  <input type="datetime-local" name="date2">
</form>

JavaScript

var control_pressed = false;

function changeInputType(oldObject, oType) {
  var newObject = document.createElement("input");
  newObject.type = oType;
  if(oldObject.size) {newObject.size = oldObject.size;}
  if(oldObject.value) {newObject.value = oldObject.value;}
  if(oldObject.name) {newObject.name = oldObject.name;}
  if(oldObject.id) {newObject.id = oldObject.id;}
  if(oldObject.className) {newObject.className = oldObject.className;}
  oldObject.parentNode.replaceChild(newObject,oldObject);
  newObject.select();
  return newObject;
}

function swapToText(date_type) {
    $('input[type="'+date_type+'"]').on("keydown", function(event) {
    if ((event.keyCode == 17) && (control_pressed != true)) {
      $(this).addClass("revert_date_to_text");
      changeInputType(this, "text");
      swapToDate(date_type);
      control_pressed = true;
    }
  })
}

function swapToDate(date_type) {
  $(".revert_date_to_text").on("keyup", function(event) {
    if ((event.keyCode == 17) && (control_pressed != false)) {
      $(this).removeClass("revert_date_to_text");
      if (date_type == 'datetime-local') {
        $(this).val($.format.date($(this).val().replace(/\//g,"-").replace("T"," ")+':00.000', "yyyy-MM-ddTHH:mm"));
      } else {
        $(this).val($.format.date($(this).val().replace(/\//g,"-"), "yyyy-MM-dd"));
      }
      changeInputType(this, date_type);
      swapToText(date_type);
      control_pressed = false;
    }
  })
}

$(function() {
  $.getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery-dateFormat/1.0/jquery.dateFormat.min.js');
  swapToText('date');
  swapToText('datetime-local');
});