From dccfcd43d265e10e54e0c4e7bf086dd44a7ecfc1 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Wed, 11 Oct 2023 10:22:12 -0400 Subject: [PATCH] fix date pickers --- .../NewCalibrationDeviceForm.vue | 6 +- .../Instrument/NewInstrumentForm.vue | 4 +- benchtop-fe/src/components/PDF/PDF.vue | 107 +++++++++--------- benchtop-fe/src/components/UploadForm.vue | 21 +++- 4 files changed, 73 insertions(+), 65 deletions(-) diff --git a/benchtop-fe/src/components/CalibrationDevice/NewCalibrationDeviceForm.vue b/benchtop-fe/src/components/CalibrationDevice/NewCalibrationDeviceForm.vue index e66a5f9..d4416dc 100644 --- a/benchtop-fe/src/components/CalibrationDevice/NewCalibrationDeviceForm.vue +++ b/benchtop-fe/src/components/CalibrationDevice/NewCalibrationDeviceForm.vue @@ -8,9 +8,8 @@

Calibration Date

@@ -20,9 +19,8 @@

Calibration Due Date

diff --git a/benchtop-fe/src/components/Instrument/NewInstrumentForm.vue b/benchtop-fe/src/components/Instrument/NewInstrumentForm.vue index 8ab3038..673464d 100644 --- a/benchtop-fe/src/components/Instrument/NewInstrumentForm.vue +++ b/benchtop-fe/src/components/Instrument/NewInstrumentForm.vue @@ -9,9 +9,8 @@
@@ -24,7 +23,6 @@ diff --git a/benchtop-fe/src/components/PDF/PDF.vue b/benchtop-fe/src/components/PDF/PDF.vue index b1a1cc9..e372c3a 100644 --- a/benchtop-fe/src/components/PDF/PDF.vue +++ b/benchtop-fe/src/components/PDF/PDF.vue @@ -106,36 +106,36 @@ - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD   @@ -204,36 +204,36 @@ - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD - -12.500 - 0.050% - -12.510 - -12.490 - -12.500 - 0 + TBD + TBD + TBD + TBD + TBD + TBD   @@ -333,11 +333,10 @@ const i_date = () => { const year = d.getFullYear(); const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1 const day = d.getDate().toString().padStart(2, "0"); - return `${year}/${month}/${day}`; + return `${year}-${month}-${day}`; }; - const i_due_date = () => { if (props.instrument?.due_date === undefined) { return; @@ -346,7 +345,7 @@ const i_due_date = () => { const year = d.getFullYear(); const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1 const day = d.getDate().toString().padStart(2, "0"); - return `${year}/${month}/${day}`; + return `${year}-${month}-${day}`; }; const c_date = () => { @@ -357,7 +356,7 @@ const c_date = () => { const year = d.getFullYear(); const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1 const day = d.getDate().toString().padStart(2, "0"); - return `${year}/${month}/${day}`; + return `${year}-${month}-${day}`; }; const c_due_date = () => { if (props.calibration?.due_date === undefined) { @@ -367,14 +366,14 @@ const c_due_date = () => { const year = d.getFullYear(); const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1 const day = d.getDate().toString().padStart(2, "0"); - return `${year}/${month}/${day}`; + return `${year}-${month}-${day}`; }; const exportToPDF = () => { const element = document.getElementById("pdf"); var opt = { margin: 0.4, - filename: "myfile.pdf", + filename: `${props.instrument.model}_${i_date()}.pdf`, image: { type: "jpeg", quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: "in", format: "letter", orientation: "portrait" }, diff --git a/benchtop-fe/src/components/UploadForm.vue b/benchtop-fe/src/components/UploadForm.vue index 8dd7f68..f3cbac6 100644 --- a/benchtop-fe/src/components/UploadForm.vue +++ b/benchtop-fe/src/components/UploadForm.vue @@ -11,13 +11,13 @@ required id="id_report_type" > - + - +