andi 2 lat temu
rodzic
commit
0953817b1b
1 zmienionych plików z 9 dodań i 6 usunięć
  1. 9 6
      components/Extras/calendar.view.js

+ 9 - 6
components/Extras/calendar.view.js

@@ -20,8 +20,8 @@ import { ToastContainer, toast } from "react-toastify";
 import { Formik, Form, Field, ErrorMessage } from "formik";
 import * as Yup from "yup";
 import Datetime from "react-datetime";
-// import 'moment/locale/id';
-// moment.locale('id')
+import 'moment/locale/id';
+moment.locale('id')
 
 const status = [
 	{ value: "Ditindaklanjuti DIKTI", label: "Ditindaklanjuti DIKTI", className: "State-ACT" },
@@ -127,6 +127,7 @@ class Calendar extends Component {
 		const { query, token } = this.props;
 		const { id } = query;
 		const { color, laporan } = this.state;
+		console.log(data.dari_tanggal)
 
 		await toast.promise(
 			updateJadwal(token, id, {
@@ -311,12 +312,13 @@ class Calendar extends Component {
 																				{({ field, form }) => (
 																					<Datetime
 																						timeFormat={false}
-																						// locale="id"
+																						locale="id"
 																						inputProps={{ className: "form-control" }}
 																						value={field.value}
+																						dateFormat="DD MMMM YYYY"
 																						closeOnSelect={true}
 																						onChange={(e) => {
-																							form.setFieldValue(field.name, e.format("DD MMMM YYYY"));
+																							form.setFieldValue(field.name, e);
 																						}}
 																					/>
 																				)}
@@ -331,12 +333,13 @@ class Calendar extends Component {
 																				{({ field, form }) => (
 																					<Datetime
 																						timeFormat={false}
-																						// locale="id"
+																						locale="id"
+																						dateFormat="DD MMMM YYYY"
 																						inputProps={{ className: "form-control" }}
 																						value={field.value}
 																						closeOnSelect={true}
 																						onChange={(e) => {
-																							form.setFieldValue(field.name, e.format("DD MMMM YYYY"));
+																							form.setFieldValue(field.name, e);
 																						}}
 																					/>
 																				)}