page add panel/doctor role agent && save data crop img && upload img && just roles agent can access panel && save data doctor && add field phone number && remove two tab
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import moment from "jalali-moment";
|
||||
|
||||
export const dateToTimestamp = (date) => {
|
||||
const gregorianMoment = moment(date, "jYYYY/jM/jD").locale("fa");
|
||||
const unixTimestamp = gregorianMoment.valueOf();
|
||||
return unixTimestamp / 1000;
|
||||
};
|
||||
|
||||
export const transformData = (data) => {
|
||||
return {
|
||||
name: data.name.value,
|
||||
activity_time: dateToTimestamp(data.time_work.value),
|
||||
doctor_mobile_number: data.phone.value,
|
||||
degree: data.degree.value,
|
||||
specialty: [Number(data.expertise.value)],
|
||||
info: data.description.value,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user