Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Sep 10, 2024
1 parent ea7bc7d commit a6c3844
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 52 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/patient_consultation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ describe("Patient Consultation in multiple combination", () => {
patientConsultationPage.typeCauseOfDeath("Cause of Death");
patientConsultationPage.typePatientConsultationDate(
"#death_datetime",
"2024-02-22T12:45",
"22/02/2024 12:30 pm",
);
patientConsultationPage.typeDeathConfirmedBy(doctorName);
patientConsultationPage.typePatientConsultationDate(
"#encounter_date",
"2024-02-22T12:30",
"22/02/2024 12:30 pm",
);
cy.submitButton("Create Consultation");
cy.verifyNotification(
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class PatientConsultationPage {
}

typePatientConsultationDate(selector: string, date: string) {
cy.get(selector).clear().click().type(date);
cy.get(selector).click().clear().type(date);
}

clickPatientDetails() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientTreatmentPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PatientTreatmentPlan {
}

typeProcedureTime(time: string) {
cy.get("#procedure-time").type(time);
cy.get("#procedure-time").click().type(time);
}

typeTreatmentPlan(treatment: string) {
Expand Down
49 changes: 1 addition & 48 deletions src/Components/Common/DateInputV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,54 +353,7 @@ const DateInputV2: React.FC<Props> = ({
//close();
setIsOpen?.(false);
}
let value = e.target.value.replace(/[^\d]/g, "");

// Apply formatting for DD/MM/YYYY hh:mm a
if (value.length > 2 && value.length <= 4) {
value = value.slice(0, 2) + "/" + value.slice(2);
} else if (value.length > 4 && value.length <= 8) {
value =
value.slice(0, 2) +
"/" +
value.slice(2, 4) +
"/" +
value.slice(4);
} else if (value.length > 8 && value.length <= 10) {
value =
value.slice(0, 2) +
"/" +
value.slice(2, 4) +
"/" +
value.slice(4, 8) +
" " +
value.slice(8);
} else if (value.length > 10 && value.length <= 12) {
value =
value.slice(0, 2) +
"/" +
value.slice(2, 4) +
"/" +
value.slice(4, 8) +
" " +
value.slice(8, 10) +
":" +
value.slice(10);
} else if (value.length > 12) {
value =
value.slice(0, 2) +
"/" +
value.slice(2, 4) +
"/" +
value.slice(4, 8) +
" " +
value.slice(8, 10) +
":" +
value.slice(10, 12) +
" " +
value.slice(12);
}

setEditingText(value);
setEditingText(e.target.value);
}}
onBlur={() => setEditingText(null)}
/>
Expand Down

0 comments on commit a6c3844

Please sign in to comment.