Improve web signing flow and locale handling
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react';
|
||||
import { Document, Page, pdfjs } from 'react-pdf';
|
||||
import 'react-pdf/dist/Page/AnnotationLayer.css';
|
||||
import 'react-pdf/dist/Page/TextLayer.css';
|
||||
import { detectClientSignatureContext } from '../../utils/clientSignatureContext';
|
||||
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||
@@ -28,6 +29,7 @@ export default function PdfSignaturePlacer({
|
||||
signatureImage = null,
|
||||
onPlaced,
|
||||
}) {
|
||||
const clientSignatureContext = detectClientSignatureContext();
|
||||
const [numPages, setNumPages] = useState(null);
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [sigBox, setSigBox] = useState(null); // { x, y } in container px
|
||||
@@ -120,7 +122,9 @@ export default function PdfSignaturePlacer({
|
||||
});
|
||||
};
|
||||
|
||||
const previewDate = new Date().toLocaleDateString('es-EC');
|
||||
const previewDate = new Date().toLocaleDateString(clientSignatureContext.locale, {
|
||||
timeZone: clientSignatureContext.timeZone,
|
||||
});
|
||||
|
||||
const renderPreview = () => {
|
||||
if (signatureStyle === 'qr') {
|
||||
|
||||
Reference in New Issue
Block a user