Browse Source

fix report activity dateformat

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
29158d9115
  1. 7
      edit-mode/function/reportActivity.js
  2. 2
      edit-mode/index.html

7
edit-mode/function/reportActivity.js

@ -341,10 +341,15 @@ $(document).ready(function () {
}); });
$('#ra_date_material').datepicker({
format: 'dd-mm-yyyy', // Set the desired format
autoclose: true // Close the datepicker when a date is selected
});
$("#form_report_activity_material").on("submit", function (e) { $("#form_report_activity_material").on("submit", function (e) {
e.preventDefault(); e.preventDefault();
var formData = new FormData(this); var formData = new FormData(this);
let formattedDate = moment(formData.get("report_date"), "DD-MM-YYYY").format("YYYY-MM-DD");
formData.set('report_date', formattedDate);
formData.append("activity_id", activityId); formData.append("activity_id", activityId);
formData.append("assign_material_id", assignMaterialId); formData.append("assign_material_id", assignMaterialId);
let idRa = $("#id_ra_material").val(); let idRa = $("#id_ra_material").val();

2
edit-mode/index.html

@ -723,7 +723,7 @@
</div> </div>
<div class="col-md-2 form-group"> <div class="col-md-2 form-group">
<label>Report Date</label> <label>Report Date</label>
<input type="date" id="ra_date_material" name="report_date" class="form-control form-control-sm" <input type="text" id="ra_date_material" name="report_date" class="form-control form-control-sm"
required /> required />
</div> </div>
<div class="col-md-2 form-group"> <div class="col-md-2 form-group">

Loading…
Cancel
Save