fix(07-01): auto-convert date slashes to dots after picker selection
Added change event listener that automatically replaces forward slashes with dots in date fields after user makes a selection. This ensures consistent DD.MM.YYYY format throughout the form interaction. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -138,6 +138,19 @@ if ( $is_edit_mode ) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
// Fix date format after user selects a date - replace slashes with dots
|
||||||
|
$(document).on('change', 'input[type="date"], input.frm_date', function() {
|
||||||
|
var field = $(this);
|
||||||
|
var value = field.val();
|
||||||
|
|
||||||
|
// If the value contains slashes, replace them with dots
|
||||||
|
if (value && value.includes('/')) {
|
||||||
|
var fixedValue = value.replace(/\//g, '.');
|
||||||
|
field.val(fixedValue);
|
||||||
|
console.log('Fixed date format from', value, 'to', fixedValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user