feat(07-01): improve date field prepopulation with format conversion

Added JavaScript to convert YYYY-MM-DD dates to DD.MM.YYYY format when prepopulating date fields. This is a partial fix for the date field issues - full fix requires Formidable Forms configuration.

Also updated ISSUES.md with detailed documentation of all three date field problems: initial format, picker display, and post-selection format.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 21:43:42 +09:00
parent 18ddcd5e0a
commit f229af23f5
2 changed files with 35 additions and 15 deletions

View File

@@ -117,7 +117,20 @@ if ( $is_edit_mode ) {
} else if (field.is(':checkbox') || field.is(':radio')) {
field.filter('[value="' + value + '"]').prop('checked', true);
} else {
field.val(value);
// For date fields, convert YYYY-MM-DD to DD.MM.YYYY format
if (field.attr('type') === 'date' || field.hasClass('frm_date')) {
// Check if value is in YYYY-MM-DD format
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
var parts = value.split('-');
var formattedDate = parts[2] + '.' + parts[1] + '.' + parts[0];
field.val(formattedDate).trigger('change');
console.log('Converted date from', value, 'to', formattedDate);
} else {
field.val(value);
}
} else {
field.val(value);
}
}
console.log('Populated field ' + fieldId + ' with:', value);
} else {