You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
optimize input experience
This commit is contained in:
@@ -155,6 +155,14 @@ window.formatDate = function(input, type) {
|
||||
return formatted;
|
||||
}
|
||||
} else {
|
||||
// Only allow numbers if not starting with 'n'
|
||||
const numbersOnly = value.replace(/\D/g, '');
|
||||
if (numbersOnly !== value) {
|
||||
input.value = numbersOnly;
|
||||
value = numbersOnly;
|
||||
formatted = numbersOnly.slice(0, 4);
|
||||
}
|
||||
|
||||
// Add hyphens on 5th and 7th character
|
||||
if (value.length >= 4) {
|
||||
formatted += '-'+ value.slice(4, 6);
|
||||
|
||||
Reference in New Issue
Block a user