<NME> util.js.erb
<BEF> $(document).ready(function() {
  $('a.close').click(function(event){
    event.preventDefault();
    $(this).parent().slideUp(250);
  });

  // Spree locates hidden with prev(), which with our current version of jQuery
  // does not locate the hidden field, resulting in the delete failing. This
  // handler updates the hidden field, fixing the problem.
  $('body').on('click', 'a.remove_fields', function() {
    $(this).next("input[type=hidden]").val("1");
    return false;
  });
});
      stepMinute: 15
    }
  );
  $('.datetimepicker').datetimepicker(window.JQUERY_UI_DATETIME_PICKER_DEFAULTS);
  $('a.close').click(function(event){
    event.preventDefault();
    $(this).parent().slideUp(250);

<MSG> add flatpickr to order cycle and .datetimepicker

Add your new date(time)picker on both order cycle and elements with class `.datetimepicker`
set the right options to datetimepicker

<DFF> @@ -24,7 +24,19 @@ $(document).ready(function(){
       stepMinute: 15
     }
   );
-  $('.datetimepicker').datetimepicker(window.JQUERY_UI_DATETIME_PICKER_DEFAULTS);
+  window.FLATPICKR_DATE_DEFAULT = {
+    dateFormat: "Y-m-d H:i",
+    locale: I18n.locale
+  }
+  window.FLATPICKR_DATETIME_DEFAULT = Object.assign(
+    {},
+    window.FLATPICKR_DATE_DEFAULT,
+    {
+      enableTime: true,
+      time_24hr: true,
+    }
+  );
+  flatpickr(".datetimepicker", window.FLATPICKR_DATETIME_DEFAULT);
   $('a.close').click(function(event){
     event.preventDefault();
     $(this).parent().slideUp(250);

{'addition_count': 13, 'commit_subject': 'add flatpickr to order cycle and .datetimepicker', 'deletion_count': 1, 'file_extension': '.erb', 'lang': 'js', 'license': 'agpl-3.0', 'repo_name': 'openfoodfoundation/openfoodnetwork'}