Improve regexes for year input boxes in new artwork form

This commit is contained in:
Alex Cabal 2024-04-16 11:19:25 -05:00
parent 79bb41de42
commit c486fc1680

View file

@ -42,7 +42,7 @@ $now = new DateTimeImmutable('now', new DateTimeZone('America/Juneau')); // Late
type="text" type="text"
name="artist-year-of-death" name="artist-year-of-death"
inputmode="numeric" inputmode="numeric"
pattern="[0-9]+" pattern="[0-9]{1,4}"
autocomplete="off" autocomplete="off"
value="<?= Formatter::EscapeHtml($artwork->Artist->DeathYear) ?>" value="<?= Formatter::EscapeHtml($artwork->Artist->DeathYear) ?>"
/> />
@ -62,7 +62,7 @@ $now = new DateTimeImmutable('now', new DateTimeZone('America/Juneau')); // Late
type="text" type="text"
name="artwork-year" name="artwork-year"
inputmode="numeric" inputmode="numeric"
pattern="[0-9]+" pattern="[0-9]{1,4}"
autocomplete="off" autocomplete="off"
value="<?= Formatter::EscapeHtml($artwork->CompletedYear) ?>" value="<?= Formatter::EscapeHtml($artwork->CompletedYear) ?>"
/> />
@ -129,7 +129,7 @@ $now = new DateTimeImmutable('now', new DateTimeZone('America/Juneau')); // Late
type="text" type="text"
name="artwork-publication-year" name="artwork-publication-year"
inputmode="numeric" inputmode="numeric"
pattern="[0-9]+" pattern="[0-9]{4}"
autocomplete="off" autocomplete="off"
value="<?= Formatter::EscapeHtml($artwork->PublicationYear) ?>" value="<?= Formatter::EscapeHtml($artwork->PublicationYear) ?>"
/> />