File tree Expand file tree Collapse file tree
src/components/exhibition-consent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,14 +25,22 @@ function formatSignatureDate(value?: string | null) {
2525 return `${ year } .${ month } .${ day } ` ;
2626}
2727
28+ function formatTodayDate ( ) {
29+ const date = new Date ( ) ;
30+ const year = date . getFullYear ( ) ;
31+ const month = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , "0" ) ;
32+ const day = String ( date . getDate ( ) ) . padStart ( 2 , "0" ) ;
33+ return `${ year } .${ month } .${ day } ` ;
34+ }
35+
2836export default function SignatureSection ( {
2937 mode,
3038 signatureDataUrl,
3139 signedAt,
3240 onSignatureChange,
3341} : SignatureSectionProps ) {
3442 const isReadOnly = mode === "readonly" ;
35- const displayDate = formatSignatureDate ( signedAt ) ;
43+ const displayDate = isReadOnly ? formatSignatureDate ( signedAt ) : formatTodayDate ( ) ;
3644 const displaySignatureUrl = normalizeImageUrl ( signatureDataUrl ) ;
3745
3846 const handleClear = ( ) => {
You can’t perform that action at this time.
0 commit comments